views:

200

answers:

1

hi all,

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.

+5  A: 

Using the PRG pattern.

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

dfowler
thanks a lot! i had never heard of this pattern before. In asp.net mvc you have to use RedirectToAction(c => c.Action(object)); found in mvc contrib and [AcceptVerbs(HttpVerbs.Get)] in the actions that only render the required view.
Yannis