How to redirect by throwing an exceptions from an Asp.NET controller?
- by ripper234
My controllers all extend a basic UserAwareController class, that exposes GetCurrentUser() method. I would like any call to this method to redirect to the login page if the user is not already logged in.
Can I accomplish this by throwing some exception from this method? How can I cause a redirect to happen when this exception is thrown?