I have an application with the custom form authentication. I have added restrictions on accessing to some actions based on user roles. I have overridden Application_PostAuthenticateRequest(Object sender, EventArgs e)
and it works OK. The only problem is that currently the application redirects a user to a login page if for instance "Editor" is trying to access to actions available only for "Admins". I know it is because I have set the default page to log-in
page in Web.config
. Ideally I would like a user to be redirected to a warning page instead of a login page. How can I do it?
Thanks
EDIT: The answer to this question may also be found here: ASP.NET MVC redirect to an access denied page using a custom role provider