Using RedirectToAction

The RedicrectToAction simply generates a HTTP 302 code witch tells the browser to get the next page.
It is important to remember that when this is used inside a view then we should return RedicrectToAction. This will render the View to the client (and make it redirect) and will stop any further execution (if the RedirectToAction for instance is inside a if statement)

public ActionResult Upload(UploadOrderModel uploadorder)
{
	if (uploadorder.IsInvalid)
	{
		//somthing fishy is going on ...
		return RedirectToAction("Index", "Home");
	}
	//do important things here
	return View(orderInfo);
}

system.web.mvc.controller.redirecttoaction at msdn

Hiding routevalues when using RedirectToAction – ie don’t show GET params after using RedirectToAction

When we simply try and do a RedirectToAction and simply passes along a model with this then the model is serialized and sent as GET parameters to the next page. This happens because the RedicrectToAction simply returns a HTTP 302 code witch tells the browser to get the next page. If this is not what you want (perhaps you don’t wish to show the user the parameters or allow user modification), or perhaps you wish to pass along some object or similar.

One way around this is to store the data for the next Action in TempData and re-read it in the next action.

public ActionResult Index(MyModel myModel)
{
    TempData["MyModel"] = myModel;
    return RedirectToAction("NextStep", "MyController");
}
 
public ActionResult NextStep(MyModel myModel)
{
    myModel = TempData["MyModel"] as MyModel ?? myModel;
    return View(myModel);
}

system.web.mvc.controller.redirecttoaction at msdn