If statement with dataitems in markup
Posted
by Eric
on Stack Overflow
See other posts from Stack Overflow
or by Eric
Published on 2010-04-05T19:58:21Z
Indexed on
2010/04/05
20:03 UTC
Read the original article
Hit count: 379
I am trying to write an if statement to decide whether or not to display a field. I'm using a listview.
<telerik:RadListView ID="RadListView4" runat="server" ItemPlaceholderID="WitnessPlaceHolder"
DataSourceID="SqlDataSource5">
<LayoutTemplate>
<asp:PlaceHolder ID="WitnessPlaceHolder" runat="server" />
</LayoutTemplate>
<ItemTemplate>
<center>
<fieldset style="float: left; width: 280px;">
<legend>
<%# Eval("title").ToString()%>
</legend>
<table>
<tr>
<td align="center">
<%if (DataBinder.Eval(Container.DataItem,"field").Equals("C"))
Response.Write(Eval("field"));%>
</td>
How can I write the above if statement in the markup?? What i have doesn't work.
© Stack Overflow or respective owner