I have been doing this research for 2 days now, but i cant seem to find the answer.
How to redirect user to a specific page
This is what I have now:
<authentication mode="Forms">
<forms loginUrl="~/Account/Member/LogOn" timeout="2880" />
</authentication>
What i want to do is if user isn’t authenticated redirect to this url: ~/Account/Member/LogOn”
but if the user is already authenticated but not authorized, I want to redirect to this url:
~/Account/Member/Unauthorized”
Is there anyway to do this without creating a custom authentication attribute?’
Thanks
You can make a base controller class and override OnActionExecuting method and then inherit that controller. See following reference for details.
How to redirect from OnActionExecuting in Base Controller?