I have a folder called reports. I set the its security through "asp.net Configuration to deny * users but allow user AAAA. When user BBBB tries to access this folder, BBBB gets redirected to the login page. Where and how do I redirect them to another customized
page?
For MVC, you need to create an attribute that derives from AuthorizeAttribute and override the OnAuthorization method. It's easy, see this post in the same thread as above: http://forums.asp.net/post/3604539.aspx
Darrell Norton, MVP
Darrell Norton's Blog Please click "Mark as Answer" if this helped you.
Marked as answer by caolong on Jan 09, 2013 04:39 PM
caolong
Member
5 Points
31 Posts
Access denied Redirect
Jan 07, 2013 04:08 PM|LINK
Hi,
I have a folder called reports. I set the its security through "asp.net Configuration to deny * users but allow user AAAA. When user BBBB tries to access this folder, BBBB gets redirected to the login page. Where and how do I redirect them to another customized page?
Thanks
DarrellNorto...
All-Star
86805 Points
9644 Posts
Moderator
MVP
Re: Access denied Redirect
Jan 08, 2013 09:31 AM|LINK
For Web Forms, see the code in this post here: http://forums.asp.net/post/3603833.aspx
For MVC, you need to create an attribute that derives from AuthorizeAttribute and override the OnAuthorization method. It's easy, see this post in the same thread as above: http://forums.asp.net/post/3604539.aspx
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.