I am writing ASP.NET MVC application.
When the user first logs in, the application should display a page for his acceptance of the Terms of Use.
If the user does not accept the terms, he will be redirected to log in page. If he accepts the Terms, then he can continue using my app.
Where is the best place in the application where I can check this condition in order to call ReddirectToAction ?
I am writing ASP.NET MVC application. When the user first logs in, the application
Share
If you have a “BaseController” type class that all other controllers inherit from, override the OnActionExecuting method and make the check there.
ETA – Obviously the controller that presents the terms page wouldn’t have that behavior or you would end up in a redirect loop, so you would need to have a “BaseLoggedInController” or some such thing that all the controllers except for the one that presents the terms/login pages would inherit from.