且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我想为“取消"按钮编写代码,如果我单击“取消"按钮,则应该取消对文件的处理.

更新时间:2023-11-24 14:48:40

FileUpload控件是一个非常简单的上传控件.当您单击页面的上载按钮时,文件将随浏览器的pagepostback-request发送.此过程无法停止或管理,因为它是Web浏览器与网站进行通信的一部分(客户端请求>服务器答复).

您能够管理此过程的唯一方法是制作一个客户端对象(Flash/JavaScript或类似的对象),该对象将接管与网站的通信以上传文件.在Google中有很多此类上传控件的示例,我目前还没有一个很好的了解,但是通过一点点搜索和测试,您会找到一个适合您的.

使用进度条使用Flash和ASP.NET进行多个文件上传 [
The FileUpload control a very minimal and simple upload control. When you click the upload button of your page the file will be send with the pagepostback-request of the browser. This process cannot be stopped or managed as it is part of the webbrowsers communication with the website(client requests > server answers).

The only way you are able to manage this process is to make a clientside object(flash/javascript or something like that) that will take over the communication with the website for the uploading of the file. There are a lot of examples of these kinds of upload-controls found in google, I currently don''t have a good one I know of, but with a little bit of searching and testing you''ll find one for you.

Multiple File Upload With Progress Bar Using Flash and ASP.NET[^]



我不确定,但是,您可以做一件事,即可以在取消"按钮上刷新页面,这样就可以停止正在运行的进程.

但是我不认为这是可能的解决办法!

如果我错了,我很抱歉!

问候,
克鲁纳尔·潘查尔(Krunal Panchal)
Hi,
I am not sure but, you can do one thing that you can refresh the page on cancel button so what ever the process was running it will be stopped.

But i dont think so that this is the possible solution or not!!

I am sorry if i am wrong!!

Regards,
Krunal Panchal