views:

40

answers:

1

In my project I need to disable a hyperlink based on some condition. So how can I do this from code behind using C#?

+1  A: 

in your aspx, add runat="server" attribute to the tag:

<a id="myHyperLink" runat="server">...</a>

in Page_load method:

if( condition )
    myHyperLink.Enabled = false;
onof