找不到上传的文件更新面板内 [英] Unable to find uploaded file inside Update panel

查看:157
本文介绍了找不到上传的文件更新面板内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 aspx: 

<asp:UpdatePanel ID="updtEmpMaster" runat="server">
<ContentTemplate>

<asp:FileUpload ID="tPhoto" Height="23px" runat="server" />
<asp:Button ID="Button1" CssClass="btnImage" runat="server" Text="OK" 
onclick="Button1_Click" />

</ContentTemplate>
</asp:UpdatePanel>  


aspx.cs:

protected void Button1_Click(object sender, EventArgs e)
{
    if (tPhoto.HasFile)
    {
    …………………..;
    }
    else
    {
        …………………..;
    }
}   

下面,如果条件是一个图像文件上传,即使失败。当没有更新面板使用没有问题。更新面板也需要在当前情况下。任何方法可以让我有更新面板解决方案。任何帮助将是非常美联社preciated。在此先感谢:)

Here if condition is failing even after an image file is uploaded. No problem when using without Update panel. Update panel is also needed in current scenario. Any way I can have solution with Update panel. Any help will be highly appreciated. Thanks in advance :)

推荐答案

根据链接 HTTP ://forums.asp.net/p/1105208/1689084.aspx

这个问题就有点有据可查,更新面板被列为不工作具有一定的控制。

This problem is somewhat well documented, the update panel is listed as not working with certain controls.

文件上传,和树视图是2 BIGGIES的。

File upload, and tree view being 2 of the biggies.

在任何情况下,一种解决方案可在code项目:

IN any case, one solution is available on code project:

HTTP://www.$c$cproject.com/useritems/simpleajaxupload。 ASP

如果你看看周围的论坛,谷歌,你可以,如果你有兴趣了解更多关于这个问题,但code项目解决方案应该让你开始。

if you look around the forums and google, you can read more about the problem if your interested, but the code project solution should get you started.

这篇关于找不到上传的文件更新面板内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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