title: ASP.NET MVC: What is the correct way to redirect to pages/actions in MVC?
body: <p>I am fairly new to MVC but not sure exactly which Redirect... replaces the standard redirect used in WebForms is the standard <code>Response.Redirect()</code></p>
  <p>For instance, I need to redirect to other pages in a couple of scenarios:</p>
  <ol>
  <li>WHen the user logs out (Forms signout in Action) I want to redirect to a login page.</li>
  <li>In a Controller or base Controller event e.g. <code>Initialize</code>, I want to redirect to another page (<code>AbsoluteRootUrl</code> + <code>Controller</code> + <code>Action</code>)</li>
  </ol>
  <p>It seems that multiple redirects get called in some cases which causes errors, something to do with the fact a page is already being redirected? How can cancel the current request and just redirect?</p>
  <p><strong>Update:</strong></p>
  <p>The answer to this question (<a href="https://stackoverflow.com/questions/1679405/system-web-mvc-controller-initialize">System.Web.Mvc.Controller Initialize</a>) indicates that <code>Initialize</code> should not be used and <code>OnActionExecuting</code> should be used?</p>
  <p>Any comments on why <code>Initialize</code> should not be used or why <code>OnAuthorization</code> is not a better option?</p>
  <p><strong>More Info:</strong></p>
  <p>This blog post (<a href="http://blog.wekeroad.com/blog/aspnet-mvc-securing-your-controller-actions/" rel="noreferrer">http://blog.wekeroad.com/blog/aspnet-mvc-securing-your-controller-actions/</a>) indicates that <code>OnActionExecuting</code> is useful for authentication (as indicated in the link above) I guess adding this to that event in the base Controller class is fine as every page runs an Action in MVC so shouldn't make much difference and having the ability to redirect should be easier. This does make sense, but it also seems to make sense to me that things could be done in an event before this event and makes we question what those events are for? Will be giving <code>OnActionExecuting</code> a go..</p>