ASP.Net Ajax的AsyncFileUpload控制未烧制服务器端OnUploadCompleted事件 [英] ASP.Net Ajax AsyncFileUpload control not firing server side OnUploadCompleted event

查看:209
本文介绍了ASP.Net Ajax的AsyncFileUpload控制未烧制服务器端OnUploadCompleted事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写信,要求用户将文件上传到服务器的应用程序。与用户的所有用户的交互是通过JQuery用户界面模式弹出窗口完成。我创建了一个测试页面,看到AsyncFileUpload控制工作,一切工作正常就可以了。我添加了AsyncFileUpload来,我需要它,在一个模式弹出的网络表单,但由于某些原因服务器端事件从来没有发射。此页面从测试页面上唯一的区别是,我通过我,在页面初始加载,存储在视图状态(所以它不会在未来的回发要求)查询字符串中发送的变量。任何想法?

I am writing an application that requires a user to upload files to the server machine. All user interaction with the user is done via JQuery UI modal popups. I created a test page to see that the AsyncFileUpload control works, and everything works fine on it. I added the AsyncFileUpload to the webform that I need it on, in a modal popup, but for some reason the server side event is never fired. The only difference on this page from the test page is that I send a variable through on the querystring which I, on initial load of the page, store in the viewstate (so it isn't required on future postbacks). Any ideas?

感谢

推荐答案

在使用AsyncFileUpload必须设置在格式标签的权利参数,可以被放置在你的页面或母版:

When you use AsyncFileUpload you must set the right params in the "form" tag, that is placed in your Page or MasterPage:

 <form id="form1" runat="server" enctype="multipart/form-data" method="post">

如果您没有设置正确的加密类型和方法的 UploadedComplete将永远不会触发,你将无法获得的 FileUpload.FileBytes ,因为文件上传.HasFile 仅在UploadedComplete执行返回true。

If you don't set the right enctype and method UploadedComplete will never fire, and you won't be able to get FileUpload.FileBytes since FileUpload.HasFile returns true only during UploadedComplete execution.

我想你没有设置你的模式弹出正确的加密类型。

I suppose that you didn't set the correct enctype on your modal popup.

此外,prevoius AsyncFileUpload版本的Chrome浏览器上没有工作。实际版本(4.1.50731.0)解决了这个问题。

Besides, prevoius versions of AsyncFileUpload didn't work on Chrome. Actual version (4.1.50731.0) solved the problem.

这篇关于ASP.Net Ajax的AsyncFileUpload控制未烧制服务器端OnUploadCompleted事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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