如何删除或限制重试/取消弹出窗口 [英] How to remove or restrict Retry/Cancel Pop-up

查看:163
本文介绍了如何删除或限制重试/取消弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

晚安朋友,
我正在设计一个Web应用程序.我需要在按F5的同时取消重试/取消"弹出窗口.由于在数据库

Good Evening Friends,
I am designing a web application. I need to cancel the Retry/Cancel Pop-Up while pressing F5 . Because duplicate values are entered in database

推荐答案

中输入了重复的值,这是由于浏览器的工作方式所致.首次发布页面时,浏览器发送所有数据,然后返回HTML进行渲染.如果您单击刷新(F5),则浏览器将重新发送上一个POST请求,从而再次发送信息.这导致记录重复.需要为此类场景/页面应用Post-Redirect-Get模式,在HTTP Post之后,而不是返回HTML,而是重定向返回页面(相同或不同).

万一您不能重定向或对重定向不满意,请查看以下文章:
ASP.Net中的刷新页面问题 [提交请求后,请刷新 [检测页面刷新 [
This is due to how browsers work. The first time you POST the page, the browser sends all the data, then returns back HTML to render. If you hit refresh (F5) then the browser re-sends the last POST request thus re-sending the information again. This causes duplication of record. One need to apply Post-Redirect-Get pattern for such scenarios/pages, where after an HTTP Post, instead of returning HTML, is redirected back to a page (either the same or another).

In case, you cannot redirect or not comfortable with redirect, have a look at these articles:
Refresh Page Issue in ASP.Net[^]
Stop Refresh after Submitting your Request[^]
Detecting Page Refresh[^]


这篇关于如何删除或限制重试/取消弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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