PRG in ASP.NET MVC but with object data transferred to the redirected action
Posted
by mare
on Stack Overflow
See other posts from Stack Overflow
or by mare
Published on 2010-04-04T10:40:21Z
Indexed on
2010/04/04
10:43 UTC
Read the original article
Hit count: 465
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?
© Stack Overflow or respective owner