问题使用ASP.NET FileUpload控件在一个UpdatePanel? [英] Problem using the ASP.NET FileUpload control in an UpdatePanel?
问题描述
我运行到一个问题,我有一个UpdatePanel一个FileUpload控件。当我尝试保存更改并上传的文件,没有文件被发现。如果我删除的UpdatePanel一切似乎很好地工作。
I'm running into an issue where I have a FileUpload control in an UpdatePanel. When I attempt to save changes and upload the file, no file is found. If I remove the UpdatePanel everything seems to work fine.
任何想法,为什么这可能发生?而且有一个变通?
Any ideas why this might be happening? And is there a work-around?
推荐答案
要上传您需要执行一个完整的ASP.NET网页提交的文件,它不会工作在部分回发的方法。
To upload a file you need to perform a full ASP.NET page postback, it does not operate over the partial postback method.
您需要注册按钮,上传你的文件在UpdatePanel的触发器的PostBackTrigger。
You'll need to register the button which "uploads" your file as a PostBackTrigger of the UpdatePanel's triggers.
有很多免费的(和non-free)AJAX文件上传解决方案,也可以很容易地创建一个,它是把你的文件上传控件的iframe内提交的iframe页面返回给服务器的只是一个问题。它不是的真正的阿贾克斯,但它给AJAX的可视化即时通讯pression。
There are lots of free (and non-free) AJAX file upload solutions, or you can easily create one, it's just a matter of putting your file upload control within an iframe and submitting the iframe page back to the server. It isn't really ajax, but it gives a visual impression of AJAX.
这篇关于问题使用ASP.NET FileUpload控件在一个UpdatePanel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!