Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi...
I want to Enable/Disable Href link according some conditions but how i don't know...???

Only Enable/Disable not Visible/Hide...

I have used following code but it's not working..
ASP.NET
<a href="User.aspx" id="href_user" runat="server">User</a>


code behind

C#
if(session["Admin"]==null)
{
href_user.Disabled=false;
}
else
{
href_user.Disabled=true;
}
Posted
Updated 22-Apr-13 2:45am
v3

1 solution

I think you need to set to true if Session value is null...
Please check...
The property Disabled works fine...
You need to set it to true if you want to disable the anchor tag...
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900