ASP.NET MVC: What is the correct way to redirect to pages/actions in MVC?

Posted by Mark Redman on Stack Overflow See other posts from Stack Overflow or by Mark Redman
Published on 2010-04-20T17:01:15Z Indexed on 2010/04/20 17:03 UTC
Read the original article Hit count: 238

Filed under:
|
|

I am fairly new to MVC but not sure exactly which Redirect... replaces the standard redirect used in WebForms ie the standard Response.Redirect()

For instance, I need to redirect to other pages in a couple of scenarios:

1) WHen the user logs out (Forms signout in Action) I want to redirect to a login page 2) In a Controller or base Controller event eg Initialze, I want to redirect to another page (AbsoluteRootUrl + Controller + Action)

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?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about c#