PRG in ASP.NET MVC but with object data transferred to the redirected action
- by mare
Following Post-Redirect-Get pattern as described in various spots but maybe in most detail here by Stephen Walter I want to use RedirectToAction but it does not accept a parameter for sending object to it. I can only send route values either as an object or as an RouteValueDictionary. So currently I send object ID and type and pull the object out of the datastore again in the action to which I redirected (like Results).
// redirect to confirm view
return RedirectToAction("ChangeSuccess", "Redirect",
new { slug = tabgroup.Slug, contentType = tabgroup.ContentType });
But I would like to send an object there because I already have it in my updating controller action so I don't need to pull it out again.
Is that possible somehow?