dhj Posted December 15, 2003 Posted December 15, 2003 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 Quote
Moderators Robby Posted December 15, 2003 Moderators Posted December 15, 2003 Instead, place a public function in your code behind to eval the status, if true return the description. Quote Visit...Bassic Software
dhj Posted December 16, 2003 Author Posted December 16, 2003 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 Quote
kahlua001 Posted December 16, 2003 Posted December 16, 2003 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.