开发者

Fileupload inside Updatepanel which in Usercontrol?

开发者 https://www.devze.com 2023-01-18 10:05 出处:网络
i am doing开发者_如何学C Fileupload using asp.net 3.5 with asp.net ajax.In that i am using Usercontrol

i am doing开发者_如何学C Fileupload using asp.net 3.5 with asp.net ajax.In that i am using Usercontrol MainPage.ascx Page:In this page i am using UpdatePanel inside Fileupload control. Demo.aspx:In this page also i am using Updatepanel. i am drag MainPage.ascx usercontrol inside this UpdatePanel which is in Demo.aspx.

Question: When i drag the Mainpage.ascx Usercontrol on Demo.aspx . Here i am getting the Fileupload.HasFile is getting null .If anybody knows Plz.

Please do the needfull.


You need to add a PostBackTrigger for your UploadControl because it is inside an update panel. (Maybe you need an AsyncPostBackTrigger)


A standard fileupload control cannot be used in an ajax-postback. You could use an AsyncFileUpload control from the ASP.NET Ajax Control Toolkit. This control can send files in an ajax-postback and has some other options that you can see in the demo.

If you use the AsyncFileUpload, make sure to use the ToolkitScriptManager from the Ajax Control Toolkit instead of the default ScriptManager.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号