ASP.NET文件上传和下载刷新问题 [英] ASP.NET File Upload & Refresh Issue

查看:64
本文介绍了ASP.NET文件上传和下载刷新问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我面临一个问题,我正在为asp.net中的文件上载控件进行编码
但是在单击带有F5的按钮刷新页面上载后,再次将该文件上传到sql服务器上.
我该如何解决该问题

Hi I am facing a problem that i am coding for file upload control in asp.net
but after uploading on clicking button refresh page with F5 again upload that file on sql server.
How can i remove that issues

推荐答案

这是因为浏览器中的刷新"会重新提交之前的请求.

要解决此问题,只需在上传成功后重定向到另一个页面即可.

您可以参考此文章以获取更多信息:提交请求后请停止刷新 [
That is because "Refresh" in the browser would resubmit the previous request.

To solve this problem, just redirect to another page once the Upload is successful.

You can refer this Article for more info: Stop Refresh after Submitting your Request[^]


当您按下F5 要刷新页面,实际上是在再次提交表单.就像再次按下提交按钮一样.

您无法删除此问题,因为您实际上是在重新提交表单,然后再次上传文件,这是此处的预期行为.
When you press F5 to refresh the page, the form is actually being submitted again. It''s like pressing the submission button again.

You can''t remove this issue, because, you are actually submitting the form again and uploading the file again is the expected behaviour here.


您好
尝试以下网址所述的解决方案

http://csharpdotnetfreak.blogspot.com/2008/12/detect- browser-refresh-to-avoid-events.html [ ^ ]

谢谢
Hi
Try out the solution as described in the following URL

http://csharpdotnetfreak.blogspot.com/2008/12/detect-browser-refresh-to-avoid-events.html[^]

Thanks


这篇关于ASP.NET文件上传和下载刷新问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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