AsyncFileUpload UploadedComplete被调用两次

时间:2014-02-10 06:59:37

标签: c# asp.net updatepanel asyncfileupload

我正在使用AsyncFileupload。文件上传完美但两次,因为事件OnUploaded complete被触发两次。我正在使用两个更新面板,如下所示

  <asp:UpdatePanel ID="UpdatePanelTop" runat="server">
<Triggers>
    <asp:PostBackTrigger ControlID="ButtonSave" />
</Triggers>
<ContentTemplate>
    <uc1:Alert ID="Alert1" runat="server" />
    <asp:Panel ID="PanelAdminUpload" runat="server"
        Width="90%">..........some code here .....
<asp:UpdatePanel runat="server" ID="UpdatePanelAFU">
            <ContentTemplate>
                <tr>
                    <td>File: </td>
                    <td class="style1">


                                                    <ajaxToolkit:AsyncFileUpload ID="AsyncFileUploadPub" runat="server"
                            ToolTip="Select the file"
                            OnUploadedComplete="AsyncFileUploadPub_UploadedComplete"
                            OnClientUploadComplete="uploadComplete"
                            UploaderStyle="Modern" UploadingBackColor="#CCFFFF" ThrobberID="myThrobber" />
                        &nbsp;<asp:Label runat="server" ID="myThrobber" Style="display: none;"><img align="middle" alt="" src="../Styles/images/Animated Gif/Uploading.gif" /></asp:Label>

                        <asp:Label ID="LabelOpt" runat="server" Text="(Optional) "></asp:Label></td>
                </tr>
                <tr>
                    <td>File Details:</td>
                    <td>
                        <asp:Label runat="server" ID="lblFileDetails" Font-Italic="true"></asp:Label></td>
                </tr>
            </ContentTemplate>
        </asp:UpdatePanel>
     ......some code here ....    </ContentTemplate>
   </asp:UpdatePanel>

1 个答案:

答案 0 :(得分:1)

问题是回发导致文件上传两次。以下链接有解决方案,请查看。

AsyncFileUpload postback causes double upload

这可能会有所帮助