Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all!!!

i have created a role "Administrators". then i created a user named Admin.
Now i am trying to set authorization for a page in my website.

Login controls are working fine. But i am able to access the page without logging in.

i added this in my web.config to set authorization

XML
<location path="~/Admin/Pages/AdminCategories.aspx">
  <system.web>
    <authorization>
      <allow roles="Administrators"/>
      <deny users="*"/>
    </authorization>
  </system.web>
</location>
Posted
Comments
Reza Ahmadi 9-Apr-12 7:19am    
What about your Authentication tag. Can you show it in your web.config?
ujjwal uniyal 9-Apr-12 7:21am    
<authentication mode="Forms">
<forms name="MonalLogin" loginUrl="~/Pages/Login.aspx" path="/" protection="All" timeout="60"></forms>

1 solution

Check the Authentication setting...Ur getting the problem due to authentication failure (as U have written U can access the page without logging in).

Better to look at the following URL

http://msdn.microsoft.com/en-us/library/aa291347(v=vs.71).aspx[^]

If you find this post solves Ur issue, please mark it as answer.
 
Share this answer
 

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