ASP.NET MVC Tip #2 - Redirecting to another action and passing information to it
Scenario:
Here's a quick little "how-to" for a pretty common task. After some controller event, you want to redirect the user to a new action, perhaps on a different controller, while passing some data along to it. Fair enough (and very simple)...
Solution:
Within your controller, you would just make a call to the following method:
RedirectToAction(new {controller="home", action="index", id=931,variable="abc"});
Of course, you need to have a route configured which can map the "variable" parameter as well. Mr. Haack has also mentioned that a future release of the MVC framework will consider any parameters not explicity defined in a route will be "overflowed" into query string parameters. A great idea in my opinion...