FileUpload控件将HasFile属性报告为false,即使在UpdatePanel不在现场时也是如此 [英] FileUpload control reports the HasFile property as false even when outsite the UpdatePanel

查看:61
本文介绍了FileUpload控件将HasFile属性报告为false,即使在UpdatePanel不在现场时也是如此的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在尝试在ASP.NET应用程序中使用一些FileUpload控件.它们在UpdatePanels外部,触发服务器上载代码的上传按钮"也是如此.如果将上载按钮设置为UpdatePanel的触发器,以便在文件上载时可以显示处理gif,则所有FileUpload控件均将其HasFile属性报告为false.为了澄清,我的页面中有相同数量的对象(FileUploads,按钮和UpdatePanel),而我来回切换的唯一一件事就是在UpdatePanel的Triggers部分中将按钮设置为异步触发器.有人知道为什么会这样或如何解决吗?如果这是正常行为,那么有人会在单击上传"按钮以指示文件上传时的处理之后,是否能实现显示某些内容(无论是弹出窗口,gif,标签还是使屏幕变暗)?

谢谢!

Hello,

I am trying to use some FileUpload controls in a ASP.NET application. They are outside UpdatePanels, and so is the "upload button" that triggers their upload code in the server. If I set the upload button as a trigger to an UpdatePanel so that I can show a processing gif while the files are uploading, then all the FileUpload controls report their HasFile property as false. To clarify, I have the same number of objects in my page (FileUploads, button and UpdatePanel) and the only thing I am switching back and forth is setting the button as an asynchronous trigger in the Triggers section of the UpdatePanel. Would someone know why this is happening or how to work around it? If that is standard behavior, would someone know how I can achieve showing something (whether a pop-up, gif, label, darken the screen) after I click the upload button to give indication of processing while the files upload?

THANK YOU!

推荐答案

请访问以下网址:

http://www.codeproject.com/KB/webforms/FileUploadWithProgrss.aspx
Please visit following:

http://www.codeproject.com/KB/webforms/FileUploadWithProgrss.aspx


这篇关于FileUpload控件将HasFile属性报告为false,即使在UpdatePanel不在现场时也是如此的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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