0

在我的网页中,我有一个Ajax 控件工具包AsyncFileUpload和一个带有触发器的DropDownList内部。UpdatePanel如果用户在下拉列表中选择了另一个项目,那么它将TextBox使用UpdatePanel.

在将其AsyncFileUpload放在页面上之前,它工作正常。添加AsyncFileUpload到页面后,UpdatePanel已停止工作以响应下拉菜单。

具体来说,它在 Internet Explorer 中仍然可以正常工作,但在 Mozilla 中无法正常工作。

如何修复此错误?

JavaScript:

<script type="text/javascript">

       function uploadStarted() {
           $get("Img_Show").style.display = "none";
       }

       function uploadComplete(sender, args) {
           var Img_Show1 = $get("Img_Show");
           //  Img_Show.src = "images/loader.gif";
           Img_Show.style.cssText = "";
           var img = new Image();
           img.onload = function () {
               Img_Show.style.cssText = "height:200px;width:209px;float:left;margin-bottom:0;position:absolute;margin-right: 0;left:0px; top:0px;padding-bottom: 15px;padding-left: 15px;padding-right: 15px;padding-top: 15px;";
               Img_Show.src = img.src;
           };
           img.src = "<%=ResolveUrl(UploadFolderPath) %>" + args.get_fileName();
       }

</script>

标记:

<cc1:AsyncFileUpload OnClientUploadComplete="uploadComplete" runat="server" ID="AsyncFileUpload1"
    ThrobberID="imgLoader" OnUploadedComplete="FileUploadComplete"  Width="100" OnClientUploadStarted = "uploadStarted"/>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:DropDownList runat="server" ID="ddlBusinessType" Style="width: 400px; left: 0px;" 
            OnSelectedIndexChanged="ddlBusinesstype_SelectedIndexChanged" 
             AutoPostBack="true" CssClass="designer" TabIndex="8"
             CausesValidation="True">
        </asp:DropDownList>

        </div>
            <span class="error">Error Class</span>
        </div>

        <asp:Panel ID="PanelBusinessType" runat="server">
            <div class="field">
                <asp:TextBox ID="txtNewBusinessType" runat="server" CssClass="textfield" TabIndex="9"></asp:TextBox>
            </div>
            <span class="error"></span>
        </asp:Panel>
    </ContentTemplate>   
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ddlBusinessType" />
    </Triggers>
</asp:UpdatePanel>
4

0 回答 0