Click here to Skip to main content
15,917,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a scenario where I have a masterpage with a hyperlink "Edit_Information"..
I want that this hyperlink should be visible to the admin only,and not to the general users...
All the users(whether admin or general users) use the same masterpage file..
How can I go about doing dis?
Updated 13-Jul-11 18:05pm

1 solution

Easy and simple check the user role and if admin change the visibility of the hyperlink to visible.
<asp:HyperLink runat="server" CssClass="link" ID="hlkEditInfo">Edit_Information </asp:HyperLink>

code behind
if (check admin role)
hlkEditInfo.Visible = true;
hlkEditInfo.Visible = false;
Share this answer
Member 8047891 13-Jul-11 23:26pm    
Is there any other way of doing it besides providing roles?
Monjurul Habib 14-Jul-11 4:26am    
yes and you will find more relevant links.
Member 8047891 14-Jul-11 5:05am    
Thanks for the help and suggestion too..

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