首页 新闻 会员 周边 捐助

asp.net刷新重新执行操作的问题!急

0
悬赏园豆:5 [已关闭问题] 关闭于 2008-02-16 11:16
<SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">用过</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">Asp.Net</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">的都知道</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">按钮操作之后会得到一个新的页面</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">然后用户通过浏览器的回退按钮可以回到原来的页面时</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">或者点刷新按钮刷新当前页面时</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">会显示对话框</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">"</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">不重新发送信息</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">则无法刷新页面</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">",</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">然后就有个</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">"</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">重试</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">","</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">取消</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">"</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">按钮</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">通常用户为了刷新页面而点击</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">"</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">重试</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">",</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">这样一点问题就来了</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">那么页面就会重复发送信息</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">并且执行先前按钮的操作</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">比如按钮是添加一行数据</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">那么刷新之后就会添加重复的数据</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">.</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体">好的程序或许会报个提示说什么不能重复添加</SPAN><SPAN style="FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: Arial">,</SPAN><SPA
侯垒的主页 侯垒 | 老鸟四级 | 园豆:3435
提问于:2008-01-31 14:56
< >
分享
所有回答(5)
0
在信息提交页面,把提交按钮设置为点击一次后就禁用。提交成功后就跳转到其它页面,比如提示操作成功的页面。这个问题没有太好的解决办法
niugm | 园豆:1685 (小虾三级) | 2008-01-31 15:11
0
在新页面执行操作完了之后重定向一下,就不会可以退回了.
沙加 | 园豆:3680 (老鸟四级) | 2008-01-31 16:17
0
这个东西不好解决,重定向,是不是仍然可以后退呀?感觉仍然有问题
任力 | 园豆:1124 (小虾三级) | 2008-01-31 17:30
0
我想你在插入时,在唯一字段上,判断一下是否已有相同记录,如果有就提示重复记录消息提示框。就算点击了“重试”按钮,也会被判断的,不知道这样是否解决了你的问题?
刚刚 | 园豆:3151 (老鸟四级) | 2008-02-03 11:01
0
用重定向没问题,也是最简单的解决办法.
Leem | 园豆:55 (初学一级) | 2008-02-05 11:31
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册