In my project i have a side menu from which I am redirecting to different pages. I have used the .NET ADMINISTRATION TOOL for the login purpose. All the pages are displayed in my side menu so that every user can view every pages. Now I want to hide some pages like "Manage Roles", "Role Authorization" etc from the ordinary users so that only the administrator can view these pages. How can I do this?
My menu is not in the master page. There is a user control called "Resources" in which the menu is created.Like this;
<div>
<ul>
<li><a href="Form1.aspx" title="Form1">Form1<a/>
<li><a href="Form2.aspx" title="Form2">Form2<a/>
<li><a href="Form开发者_JS百科3.aspx" title="Form3">Form3<a/>
<li><a href="Form4.aspx" title="Form4">Form4<a/>
<ul>
<div>
After this, this user control is added in every page. Then how can I hide some pages?
As other friends mentioned you should use authorization. If you are using Sitemap, to prevent the links to show for a particular roles you've to use security trimming. Check the following link out.
http://msdn.microsoft.com/en-us/library/ms178428.aspx
You need to implement Role Based Security
精彩评论