Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Sir,

I have a problem with my project. 
My Problem is: If a non administrator tries to access the Admin section, he should be redirected to an error page : "ErrorPage.aspx". 
I have created "ErrorPage.aspx"
But, in my Program, Unauthenticated (Non Admin) user is redirected to Login Page: "SimpleUserLoginAfterRegistration.aspx".

Kindly Help me

Below are contents of Web.config of Root Folder:

XML
<authentication mode="Forms">
<forms loginUrl="SimpleUserLoginAfterRegistration.aspx" defaultUrl="InnerPage.aspx" timeout="100" slidingExpiration="true" cookieless="UseCookies">
</forms>
        </authentication>
        <authorization>
            <allow users="*"/>
        </authorization>

And Here is the Webconfig settings in Administrator/Web.config :

XML
<?xml version="1.0"?>
<configuration>
    <system.web>
      <authorization>
        <allow roles="Administrator"/>
        <deny roles="Manager"/>
        <deny roles="User" />
      </authorization>
    </system.web>
</configuration>

Kindly Help.....
Posted

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