使用ScriptManager和更新面板进行文件上传控制 [英] File Upload control with ScriptManager and Update Panel

查看:170
本文介绍了使用ScriptManager和更新面板进行文件上传控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Asp.Net网页中使用带有Updatepannel的fileUpload控件和ScriptManager,但是当我单击上载"按钮时,尽管页面运行成功,但文件并未上载.但是如果我删除ScriptManager和Updatepanel,则文件上传成功.如何在asp.net网页中使用ScriptManager和UpdatePanel和文件上传控件?

I am using a fileUpload Control and ScriptManager with Updatepannel in a Asp.Net web page but when I click upload button The file does not upload though the page run successfully. but if I remove ScriptManager And Updatepanel the file uploaded successfully. How can I use ScriptManager and UpdatePanel With File Upload Control in a asp.net web page?

推荐答案

解决方案写在博客 http://blog中.anofsinger.com/2007/10/file-upload-not-working-on-first-html [
Solution is written in the blog http://blog.anofsinger.com/2007/10/file-upload-not-working-on-first.html[^]


添加操作事件以进行updatepanel同步或异步
add the action events for updatepanel sync or async


众所周知,文件上载"不能与更新面板"异步工作.您需要完整的回发.因此,可以将FileUpload放在UpdatePanel外部,也可以在Update Panel中为FileUpload控件定义回发触发器,例如: AjaxToolkit:AsyncFileUpload演示 [ AsyncFileUpload控件-Ajax控件工具包中的新控件 [ ^ ]
It is a known thing that File Upload does not work async with Update Panel. You need to have a complete postback for it. So, either place your FileUpload outside UpdatePanel OR have a Postback Trigger defined for FileUpload control in Update Panel, example: Using FileUpload Control inside ASP.Net AJAX UpdatePanel Control[^]


In case you want upload to be async, Microsoft released a new control that can be used:
AjaxToolkit: AsyncFileUpload Demonstration[^]
AsyncFileUpload Control - New Control in Ajax Control ToolKit[^]


这篇关于使用ScriptManager和更新面板进行文件上传控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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