I see that there is Controller.RedirectToAction(string actionName, string controllerName, object values)
but I never got the values parameter to work. Consider I want to do the following overload of actions in a controller:
public ActionResult Read()
{
return RedirectToAction("ReadPage", "MyController", 1);
}
public ActionResult ReadPage(int page)
{
// Doing the actual stuff
}
…I get exception when I try to go to the Read
action. The same goes with Html.ActionLink
.
What's up with that? Can you pass values to controllers without going to the browser at all in MVC?