Is there a way to do a conditional statement in C# for my asp.net page? I want it to be, basically:
if bool is true, add <a href>
I’ve got this:
<asp:Label ID="BenLabel" CssClass='<%#((Entry)(Container.DataItem)).HasBenform ? "EnabledEntry" : "DisabledEntry"%>' Text="Benefits Form" runat="server" />
In this way it changes its CSS class based on the bool value. However, is it possible for me to add a link, too? How would I code this?
Add an
HyperLinkand then render itVisiblebased on this boolean condition.