在浏览器刷新preventing表单重新提交不失视图状态 [英] Preventing webform resubmission on browser refresh without losing viewstate

查看:226
本文介绍了在浏览器刷新preventing表单重新提交不失视图状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

复制: http://stackoverflow.com/questions/305684/how-can-i-$p$pvent-database-being-written-to-again-when-the-browser-does-a-reload


有一个不错的优雅的方式,从当用户从他们的浏览器请求重新提交刷新表单数据停止.aspx页?

Is there a nice elegant way to stop an .aspx page from resubmitting form data if the user requests a refresh from their browser?

在理想情况下不失视图状态。

Ideally without losing the viewstate.

编辑:作为我来说,最优雅的解决方案竟然是包装相关控制在一个asp.net阿贾克斯的UpdatePanel。钽大家。

The most elegant solution for me turned out to be wrapping the relevant controls in an asp.net ajax UpdatePanel. Ta everyone.

推荐答案

有没有优雅的方式,但也有选择。正如在其他的答案中的一个说你可以做一个HTTP重定向响应。另一种解决方案是通过诸如Ajax或通过iframe提交。

There is no elegant way, but there are options. As stated in one of the other answers you can do a HTTP redirect response. Another solution is submitting through means such as Ajax, or through an iframe.

这篇关于在浏览器刷新preventing表单重新提交不失视图状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆