I have a huger web form in my MVC app. When I click my "save" button, the form is submitted and the values saved, and at the end I redirect to the same page/form. But it re renders the whole form, when it was already loaded and there is no need. How can I avoid that? I want the SAVE button to behave like: save all but continue where I was.
My controller code:
[HttpPost]
[ValidateInput(false)]
public ActionResult FormCol(FormCollection collection)
{
...
if (Request.Form["DocumentId"] != null)
{
...
return RedirectToAction("FormCol", new { id = DocumentId });
}
View:
<input type="hidden" value="@document.Id" name="DocumentId" />