I am using VS2005 C# ASP.NET 2.0.
I have used role management in the web.config with the following code snippet:
`<location path="Administrator">
<system.web>
<authorization>
<allow roles="Administrator"/>
<deny users="*" />
</authorization>
</system.web>
</location>`
However, when a user with no roles assigned tries to login, they are redirected to the custom error page which I have defined:
<customErrors defaultRedirect="~/Error/UnexpectedError.aspx" mode="On">
<error statusCode="404" redirect="~/Error/PageNotFound.aspx"/>
</customErrors>
My defaultRedirect page are for handling unexpected errors in my code.
May I know if there is an error code which I can use to redirect users who are registered but have no role assigned tries to login to another page instead of my default error page ?
you can use the defaultUrl attribute of the form tag in the web config file that way every time a user that has not enough privilages to access your files will be redirect to the defaultUrl Page.