Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to supress re-post when refreshing a page - ASP.NET MVC

I am building a wizard using asp.net mvc. currently when the user hits next (or previous) the form values are posted to an action which does any processing required and then renders the next view.

the problem i am having is that if the users hit refresh in that new view they get prompted to re-post the form values which causes a ton of problems.

In firefox i am getting the message: "To display this page, the application must send information that will repeat any action (such as a search or order confirmation) that was performed earlier."

Is there any way to prevent users from being able to re-post back to the action?

Thanks in advance.

like image 689
Yannis Avatar asked Jan 24 '10 10:01

Yannis


1 Answers

Using the PRG pattern.

http://en.wikipedia.org/wiki/Post/Redirect/Get

like image 58
davidfowl Avatar answered Sep 29 '22 12:09

davidfowl