[ACCEPTED]-Post/Redirect/Get Pattern in ASP.NET MVC-post-redirect-get
Accepted answer
The way you're doing this is fine, but it 5 looks like you might be overthinking it 4 a little bit. Do your POST actions take 3 form posts from more than one form? If 2 not, why bother with a hidden form field? You 1 could get away with a simple RedirectToAction("MyAction")
Typically, an action that handles a POST 3 knows where it needs to redirect upon successful 2 submission. Therefore, each action that 1 implements RGP can simply invoke RedirectToAction(string)
.
public ViewResult Edit(string email)
{
// save the email
return RedirectToAction("Edit");
}
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.