updatepanel问题 [英] Problem with updatepanel

查看:70
本文介绍了updatepanel问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



我的页面上有一个文件上传控件和两个按钮。我已将这些按钮放在updatepanel下并添加了触发器。我的问题是如果我上传文件后点击上传按钮,我没有得到该文件并将fileupload.hasfile作为null。



以下是我的代码





Hello All,

I have one file upload control and two buttons on my page. I have put those button under updatepanel and added triggers as well. My problem is if i click on upload button after uploading file, im not getting that file and getting fileupload.hasfile as null.

Below is my code


<tr>
<td>
<asp:Label Text="Upload:" runat="server" ID="lblUpload"></asp:Label>
</td>
<td style="padding-removed 15px">
<asp:FileUpload ID="fileUploadUsers" runat="server" ToolTip="Upload Excel" size="40" />
</td>
</tr>
 <tr>
<td colspan="2" align="center" style="padding-removed 250px; padding-removed 10px">
<asp:UpdatePanel ID="updatePanel" runat="server">
<ContentTemplate>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<asp:Button ID="btnLoad" ValidationGroup="test" runat="server" CssClass="btn75px" Text="Load" OnClick="btnLoad_Click" />
</td>
<td style="padding-removed 15px">
 <asp:Button ID="btnClear" runat="server" CssClass="btn75px" Text="Clear" OnClick="btnClear_Click" />
</td>
</tr>
 </table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnLoad" EventName="click" />
<asp:AsyncPostBackTrigger ControlID="btnClear" EventName="click" />
</Triggers>
</asp:UpdatePanel>
 </td>
 </tr>





任何人都可以帮我这个...



提前致谢...



问候,

Naveen kumar



Can any one help me on this...

Thanks in advance...

Regards,
Naveen kumar

推荐答案

您应该使用PostBackTrigger作为AsyncPostBackTrigger,它应该可以正常工作。

查看类似的解决方案这里 [ ^ ]。



- Amit
You should use PostBackTrigger instead as a AsyncPostBackTrigger and it should work fine.
See a similar solution here[^].

--Amit


这篇关于updatepanel问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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