|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Set visibility of label in itemtemplate of repeater controlof a repeater control. The repeater is bound to a datatable. It is possible that a row of this datatable is empty, in that case I would like to hide the label, not within my code-behind but within the 'aspx' (because the label is part of the itemtemplate it gets rendered in the following format 'UserControlId_RepeaterId_counter_LabelId). So I tried this (after searching several newsgroups): visible=<%# (DataBinder.Eval(Container, "DataItem.Instantie_naam").Equals(String.Empty)) ? "false" : "true" %> I can't get this to work, an ASP.NET error message is displayed in my browser: CS0030: Cannot convert type 'string' to 'bool' Anybody any ideas? Thanks in advance! Regards, Stan. Hi Stan,
you are using dotNET code inside the DataBinder.Eval, hence a "true" is seen as a string (which it indeed is). You should use true and false without the ". visible=<%# (DataBinder.Eval(Container, "DataItem.Instantie_naam").Equals(String.Empty)) ? false : true %> Grtz, Wouter van Vugt Trainer - Info Support blogs.infosupport.com/wouterv
Inheriting from the TreeNode class
CreateChildControls() always returns default property values detailsview, 3-Tier Binding Problem ????????? Enabling/diusabling child controls Input fields are renamed with runat="server", how do I change it Website on a website. button's OnClick event runs after page databinding... strange question about DropDownList Reading a public variable from a web user control |
|||||||||||||||||||||||