【问题标题】:File upload is not working with AsyncPostBackTrigger in ASP.Net文件上传不适用于 ASP.Net 中的 AsyncPostBackTrigger
【发布时间】:2013-08-10 03:57:39
【问题描述】:

我有一个 html 文件上传控件来上传个人资料图片,并且我正在使用更新面板和 AsyncPostBackTrigger 触发器。如果我使用 PostBackTrigger,则可以上传个人资料图片,但如果我使用 AsyncPostBackTrigger,则无法上传。

下面是我的内联代码:

<asp:UpdatePanel ID="pnlZerkerBasicProfile" runat="server">
<input type="file" id="myFile" name="myFile" class="file_input_hidden" onchange="javascript:FileUploadSubmit();" style="cursor: pointer;" />
<Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSaveProfilePicture" />
</Triggers>
</asp:UpdatePanel>

谁能帮忙?

【问题讨论】:

    标签: asp.net file-upload updatepanel postback partial-postback


    【解决方案1】:

    这是一个已知问题,文件上传控件需要完整的回发才能在更新面板中工作,即您不能使用 AsyncPostBackTrigger。

    编辑:刚刚看到这是FileUpload Doesn't Work When Nested In UpdatePanel? C#的副本

    【讨论】:

      猜你喜欢
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      • 2012-08-02
      • 2015-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-09
      相关资源
      最近更新 更多