song2siren
Programmer
Hello
I just need to find out the best way to add some conditional logic to a DataList. I've got the following button in my ItemTemplate:
<asp:HyperLink NavigateUrl='<%# "AddToCart.aspx?productID=" & (Container.DataItem( "ID" ))%>' Runat="server"><asp:ImageButton ID="AddtoCart" ImageUrl="Images/addtocart.gif" runat=server /></asp:HyperLink>
However, if an InStock field in my SQL database displays the bit value '0', I need to drop the HyperLink and ImageButton and just display the text, 'Out of Stock'. This seems so simple, but I'm getting nowhere!
Any help would be very much appreciated.
I just need to find out the best way to add some conditional logic to a DataList. I've got the following button in my ItemTemplate:
<asp:HyperLink NavigateUrl='<%# "AddToCart.aspx?productID=" & (Container.DataItem( "ID" ))%>' Runat="server"><asp:ImageButton ID="AddtoCart" ImageUrl="Images/addtocart.gif" runat=server /></asp:HyperLink>
However, if an InStock field in my SQL database displays the bit value '0', I need to drop the HyperLink and ImageButton and just display the text, 'Out of Stock'. This seems so simple, but I'm getting nowhere!
Any help would be very much appreciated.