我想为“取消"按钮编写代码,如果我单击“取消"按钮,则应该取消对文件的处理. [英] I want to write code for cancel button ,if i click on the cancel button it should cancel processing the file .

查看:120
本文介绍了我想为“取消"按钮编写代码,如果我单击“取消"按钮,则应该取消对文件的处理.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我创建了一个包含文件上传控制,导入按钮,取消按钮的屏幕.当我单击导入按钮时,它将从文件上传控件中选择一个文件,以从文件中读取所有记录并将其插入数据库中. > 但是现在我想为取消"按钮编写代码,如果我单击取消"按钮,它应该取消对文件的处理.
我不知道该怎么做.
请任何人提供此示例.

在此先感谢您.

Hi There,
I have created a screen which contains a file upload contol ,Import button, cancel button.When i click on Import button it is going select a file from fileupload control, to read all the records from the file and inserts into database.
But now I want to write code for cancel button ,if i click on the cancel button it should cancel processing the file .
I dont know how to do this.
Please can anyone provide an example for this.

Thanks in advance.

推荐答案

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


这篇关于我想为“取消"按钮编写代码,如果我单击“取消"按钮,则应该取消对文件的处理.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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