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

一曲冷凌霜 提交于 2019-12-19 02:37:13

问题


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.


回答1:


Using the PRG pattern.

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



来源:https://stackoverflow.com/questions/2126747/how-to-supress-re-post-when-refreshing-a-page-asp-net-mvc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!