I am having HyperLink on my webfrom in such a way that if proper user login and clicks on the link will navigate him to corresponding page. If not i make that as a non clickable field by using this code
if(isAdmin)
{ // check for admin user
Link1.NavigateUrl = "Reports.aspx";
Link1.NavigateUr2 = "Delete.aspx";
}
else
{
Link1.NavigateUrl = "javascript:return void;";
Link1.NavigateUr2 = "javascript:return void;";
}
In the else part i would like to display an alert box saying that you are not an authorized user.
I also write another code for making that link as non selectable as follows
LinkButton1.Attributes["OnClick"] = “return false;”;
So can any one tell how can i write alert message in both the cases
OR