If statement with dataitems in markup
- by Eric
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.