Author: ruipalhinhas | Posted on: 11/25/2010 5:18:40 PM | Views : 547

Hi!
I want to know how can i redirect a user to a different page when he tries to access a page restricted to another role?
The scenario is as follows:
 I have a folder "Gestao" that only allows users in role "Administrator"
<system.web> <authorization> <!--<allow roles="Administrators"/> <deny users="*"/>--> </authorization> </system.web>
If an anonymous user tries to access that folder he is redirected to the login page, but if a logged in user whose role is "friend" tries to access this folder he is also redirected to the login page. I want to redirect him to a page showing a message that he has no permission to access that page/area.
How can I do that? Should i have code on the Page_load event of the login page checking the user ...

Go to the complete details ...