AJAX.Net UpdatePanel在Gridview Templatefield中中断FileUpload [英] AJAX.Net UpdatePanel breaks FileUpload in Gridview Templatefield

查看:87
本文介绍了AJAX.Net UpdatePanel在Gridview Templatefield中中断FileUpload的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

但是,由于我已将网格视图放置在AJAX.Net更新面板中,因此,图片FileUpload.PostedFile和图片FileUpload.Filename属性为空白. :((请帮助我



帮助

解决方案

FileUpload和HtmlInputFile控件在作为异步回发的一部分上载文件时与UpdatePanel控件不兼容.
在这里阅读: UpdatePanel控件 [ AsyncFileUpload演示 [

<pre lang="xml"><asp:UpdatePanel ID="upviewalbum" runat="server">
    <Triggers>
        <asp:PostBackTrigger ControlID="btnuploadphoto" />
    </Triggers>




在上面的代码片段中, btnuploadphoto 是保存文件上传控件拍摄的图像的按钮.因此,现在您可以在updatepanel的内容模板中使用gridview.

不支持HappyCoding:cool:


updatepanel中的文件上传控件.有关更多参考,请参见msdn.


However, since I''ve put the gride view in the AJAX.Net update panel, The picture FileUpload.PostedFile and picture FileUpload.Filename properties are blank. :(( plz help me



Help

FileUpload and HtmlInputFile controls when they are used to upload files as part of an asynchronous postback are Not Compatible with UpdatePanel Controls.
Read here:
UpdatePanel Control [^]

Possible alternatives:
1. Use postback trigger in case of fileupload. Since your fileupload is a part og grid, you have to either put whole grid outside update panel or have a postback trigger for it''s operations

2. Replace your fileupload with new AsyncFileUpload control released as a part of Ajax XontrolToolkit lately. Look here: AsyncFileUpload Demonstration[^]


Hi ..
Use the GridView in the Update panel and use the triigger for that ... it will work...

<pre lang="xml"><asp:UpdatePanel ID="upviewalbum" runat="server">
    <Triggers>
        <asp:PostBackTrigger ControlID="btnuploadphoto" />
    </Triggers>




In the above code snippet btnuploadphoto is the button to save the image that is taken by fileupload control..thats it now you can use the gridview in the content template of updatepanel.

HappyCoding:cool:


Fileupload control in updatepanel is not supported. see msdn for further reference.


这篇关于AJAX.Net UpdatePanel在Gridview Templatefield中中断FileUpload的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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