473,387 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DataBinder

Hello,
I create in datagrid <ItemTemplate><%#DataBinder.Eval(Container.DataIte m,
"ID_0061_PREDECESSOR")%></ItemTemplate>. This is written in HTML code. But
now is shown Guid 0000-00000-0000.... in datagrid. But I need create in
ItemTemplate "IF" construction like this:

If DataBinder.Eval(Container.DataItem, "ID_0061_PREDECESSOR")!=Guid.Empty
DataBinder.Eval(Container.DataItem, "ID_0061_PREDECESSOR")

So if ID_0061_PREDECESSOR isn't empty, then write in page the value of
ID_0061_PREDECESSOR.
How can I create this construction?

Thanks Lubos
Nov 19 '05 #1
1 1531
<%# If (GUID) DataBinder.Eval(Container.DataItem, "ID_0061_PREDECESSOR") !=
Guid.Empty
DataBinder.Eval(Container.DataItem, "ID_0061_PREDECESSOR") %>

And don't forget to imort the proper namespace for the GUID

Hope that helps!
Ragards,
Kostadin Kostov

"l" wrote:
Hello,
I create in datagrid <ItemTemplate><%#DataBinder.Eval(Container.DataIte m,
"ID_0061_PREDECESSOR")%></ItemTemplate>. This is written in HTML code. But
now is shown Guid 0000-00000-0000.... in datagrid. But I need create in
ItemTemplate "IF" construction like this:

If DataBinder.Eval(Container.DataItem, "ID_0061_PREDECESSOR")!=Guid.Empty
DataBinder.Eval(Container.DataItem, "ID_0061_PREDECESSOR")

So if ID_0061_PREDECESSOR isn't empty, then write in page the value of
ID_0061_PREDECESSOR.
How can I create this construction?

Thanks Lubos

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michelle Keys | last post by:
Subject: DataBinder.Eval Error! Server Error in '/MSPOS' Application. ------------------------------------------------------------------------ -------- DataBinder.Eval:...
2
by: dm_dal | last post by:
I have a control on my webform that I am binding to a dataset. The issue is, the field value in the dataset is encrypted and I am trying to decrypt it during the binding process: Example: ...
5
by: bg | last post by:
Hi! How do I check if "date" exists before using that code? I've built a RSSreader and sometimes there's a date in it and sometimes not. How can I check if it exists to avoid crash...
4
by: Søren Lund | last post by:
Hello, I am trying to bind a DataGrid with some data from a DataSet which contains fields in the form "group.fieldname". I am certain that my data source contains the field but I cannot get my...
1
by: Mike Lerch | last post by:
Pretty much, TSIA, but I'll expand a bit: I'm still trying to get my head around the n-tier approach to web design. It seems to me that when you use DataBinder.Eval in the ASPX that your tiers...
2
by: jack | last post by:
Hello, I have a date in a SQL Database and want to use the dateformat tools to format the output. I am now using the Month, Day, and Year to do it now. I want to change: Released Date:...
3
by: Aleko Petkov | last post by:
Hi, I want to display different content in a DataGrid row, depending on the value returned by a DataBinder. I am trying to write something like this: <ItemTemplate> <% if(...
4
by: CharlesA | last post by:
a general question... I'm a bit mystified by Databinder.eval(object, Colname, ) if controls can be bound to their individual data sources within the load event of the page... why would we ever...
1
by: RobASPNewGuy | last post by:
Hi, I'm new to this forum and hope I can get some help. I would like to make life easier by combining a appSetting (global variable set in the web.config file) and DataBinder.Eval to create a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.