Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi

i need to do something like follows

say in a table i have 2 fields as status (boolean) and description(string)

i i need to check status and if it is true only display the description

 

this is what i wrote in my page_load of C# page

 

MyList.DataSource = productCatalogue.GetProducts(categoryId);

MyList.DataBind();

 

Mylist is a DataList and from GetProducts function i can get all the details of the table

 

And in aspx page i wrote

<%# DataBinder.Eval(Container.DataItem, "description") %>

 

what my problem is i don't know how to check the status here

 

this is in a web application in C# .net environment

 

if anyone have an idea pls help

thank you

Posted

hi robby

thank you for replying, but if u can give me an example that would be great cos i don't understand what u asked me to do.

thank you

Posted

CODE BEHIND

Public Function evaluate(ByVal Value1 As String, ByVal Value2 As String) As String

 

'Do some comparison, set your strTemp

Dim strTemp As String

RETURN strTemp

 

End Function

 

.ASPX

 

<%# evaluate(DataBinder.Eval(Container.DataItem, "value1"), DataBinder.Eval(Container.DataItem, "value2"),%>

 

 

OR

 

use OnItemDataBound in your datalist.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...