Quantcast
Channel: How can I prevent form resubmission in MVC - Stack Overflow
Viewing all articles
Browse latest Browse all 3

How can I prevent form resubmission in MVC

$
0
0

My current situation is as follows.I have a form that when it gets submitted, passes the model into the controller and it does what it needs to do. At the end it redirects to a confirmation page that also gets passed the same model. All of that works fine, except when I am on the confirmation page, whenever I reload the page it resubmits the form.

I've tried using TempData but when I use that it requires for my model to be serializable and my model uses other models inside it that were made by other people that all need to be serializable which would result in like 15-20 different classes all needing to become serializable which just doesnt seem reasonable.

Here is some of what I am working with:

[HttpPost]public async Task<ActionResult> SubmitClaim(WarrantyClaim model){        ... code ...      return BeddingWarrantyConfirmation(model);}public ActionResult BeddingWarrantyConfirmation(WarrantyClaim model){    return View("BeddingWarrantyConfirmation",model);}

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images