mercredi 22 juin 2016

If then Else in ASP.NET Repeater with Checkbox

I have an ASP ItemTemplate with a field of <%#Eval("GenuineOnly")%>

If GenuineOnly.ToString().Length > 0 Then I want to show this code

<td>GENUINE ONLY</td>

Else I want to show this code

<td><asp:CheckBox ID="orderPartNumber" runat="server"/><asp:HiddenField ID="hiddenPartNumber" Value ='<%#Eval("PartNumber")%>'></td> 

I've tried a number of different ways but can't seem to get the syntax right! Any help would be appreciated.

Aucun commentaire:

Enregistrer un commentaire