0

Ajax 更新面板内的按钮单击在 Chrome 和 IE 中不起作用,但在 Firefox 中起作用。我在此链接中添加文件。任何人都可以帮助我吗?我会很高兴的。谢谢 我的代码地址- 错误屏幕图片

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <table id="TblMain" cellspacing="0" cellpadding="0" width="100%" border="0">
                    <tr>
                        <td align="left">
                            <div class="module_box">
                                <asp:HyperLink ID="lnkUseCoupons" CssClass="lightbox addbutton" runat="server" NavigateUrl="/store/addcoupon.aspx"><%=GetGlobalResourceObject("lang", "AddCoupon")%></asp:HyperLink>
                                <div class="clear">
                                </div>
                                <asp:Label ID="lblCouponInfo" runat="server" EnableViewState="False"></asp:Label>
                                <asp:LinkButton ID="btnDeleteCoupon" runat="server" CssClass="deletebutton" Visible="False"><%=GetGlobalResourceObject("lang", "Delete")%></asp:LinkButton>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td id="SepetlerContainer" runat="server">
                            <div class="module_box">
                                <label class="subtitle">
                                    <%=GetGlobalResourceObject("lang", "Carts")%></label>
                                <table cellpadding="1" cellspacing="0" border="0" width="100%">
                                    <tr>
                                        <td colspan="2">
                                            <div id="transferalert" visible="false" runat="server" class="alert">
                                                <%=GetGlobalResourceObject("lang", "CartMsg5")%></div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <table id="TblSepetler" cellspacing="0" cellpadding="0" width="100%" border="0" runat="server">
                                                <tr>
                                                    <td>
                                                        <%=GetGlobalResourceObject("lang", "SelectCart")%>
                                                        <asp:DropDownList ID="ddlSepet" runat="server" DataTextField="CartType" DataValueField="ShoppingCartDefId"
                                                            AutoPostBack="True">
                                                        </asp:DropDownList>
                                                        <asp:HyperLink ID="lnkaddnew" CssClass="addbutton lightbox" runat="server"><%=GetGlobalResourceObject("lang", "AddNew")%></asp:HyperLink>
                                                        <asp:HyperLink ID="lnkEdit" CssClass="editbutton lightbox" runat="server"><%=GetGlobalResourceObject("lang", "Edit")%></asp:HyperLink>
                                                        <asp:LinkButton ID="lnkDeleteCart" CssClass="deletebutton" runat="server"><%=GetGlobalResourceObject("lang", "Delete")%></asp:LinkButton>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td align="right">
                                            <table id="TblTransfer" runat="server">
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblTr" runat="server"><%=GetGlobalResourceObject("lang", "SelectTargetCart")%></asp:Label>
                                                        <asp:DropDownList ID="ddlTransferSepet" runat="server" DataTextField="CartType" DataValueField="ShoppingCartDefId"
                                                            AutoPostBack="True">
                                                        </asp:DropDownList>
                                                        <asp:LinkButton ID="lnkTransfer" CssClass="transferbutton" runat="server"><%=GetGlobalResourceObject("lang", "TransferToCart")%></asp:LinkButton>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td id="SepetContainer" runat="server">
                            <div class="module_box">
                                <label>
                                    <asp:Label ID="lblKampanya0" runat="server"></asp:Label></label>
                                <table id="TblSepet" cellspacing="0" cellpadding="2" width="100%" border="0">
                                    <tr>
                                        <td>
                                            <asp:DataGrid ID="DataGrid0" runat="server" Width="100%" AutoGenerateColumns="False"
                                                CellPadding="4" DataKeyField="Qty" CssClass="datalist" HeaderStyle-CssClass="title"
                                                GridLines="none" ItemStyle-CssClass="row">
                                                <Columns>
                                                    <asp:TemplateColumn Visible="False">
                                                        <ItemTemplate>
                                                            <asp:Label ID="ProductId" runat="server" Visible="False" Text='<%# Eval("ProductId") %>'> </asp:Label>
                                                            <asp:Label ID="RecordId" runat="server" Visible="False" Text='<%# Eval("RecordId") %>'> </asp:Label>
                                                        </ItemTemplate>
                                                        <HeaderStyle Width="0px"></HeaderStyle>
                                                    </asp:TemplateColumn>
                                                    <asp:TemplateColumn HeaderText="<%$ Resources:lang, ProductCode%>" Visible="False">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="Hyperlink2" runat="server" Text='<%# Eval("ProductCode")  %>'
                                                                NavigateUrl='<%# String.Format(BaseUrl2() + "{0}" + ".aspx",Eval("Url").ToString().Remove(Eval("Url").ToString().Length - 1, 1)) %>'> </asp:HyperLink>
                                                        </ItemTemplate>
                                                    </asp:TemplateColumn>
                                                    <asp:TemplateColumn ItemStyle-Width="80px" HeaderText="<%$ Resources:lang, ProductImage%>"
                                                        HeaderStyle-HorizontalAlign="Center">
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        <ItemTemplate>
                                                            <img alt="" class="thumb" src='<%# "/store/makethumb.aspx?file=" + Eval("Path") + "&intSize=50" %>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateColumn>
                                                    <asp:TemplateColumn HeaderText="<%$ Resources:lang, ProductName%>">
                                                        <ItemTemplate>
                                                            <itemstyle wrap="False"></itemstyle>
                                                            <asp:HyperLink ID="Hyperlink7" runat="server" Text='<%# Eval("ProductName") %>'
                                                                NavigateUrl='<%# string.Format(BaseUrl2() + "{0}" + ".aspx",Eval("Url").ToString().Remove(Eval("Url").ToString().Length - 1, 1)) %>'> </asp:HyperLink>
                                                            <asp:Label ID="Hy7a" runat="server" Text='<%# Eval("Description").ToString().Replace(",","</br>")  %>'></asp:Label>
                                                            <asp:HyperLink ID="Hyperlink1a6" Visible='<%# visible1(Eval("ProductId"))%>'
                                                                runat="server" NavigateUrl='<%# linkgen1() %> '> </asp:HyperLink>
                                                        </ItemTemplate>
                                                    </asp:TemplateColumn>
                                                    <asp:TemplateColumn HeaderText="<%$ Resources:lang, Point%>">
                                                        <ItemTemplate>
                                                            <itemstyle wrap="False"></itemstyle>
                                                            <asp:Label ID="lblPuan" runat="server"> </asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateColumn>
                                                    <asp:TemplateColumn HeaderText="<%$ Resources:lang, Quantity%>">
                                                        <ItemStyle Wrap="False" Width="120" HorizontalAlign="left"></ItemStyle>
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="Quantity" Enabled='<%# Interaction.IIf(Eval("ProductId").ToString().intyap() == tmpOrder.Campain.ProductId & tmpOrder.Campain.DiscountType == 2, false, true)%>'
                                                                runat="server" Text='<%# Eval("Qty") %>' MaxLength="4"
                                                                Columns="4"> </asp:TextBox>
                                                            &nbsp;<asp:Label ID="UnitId" runat="server" Visible="False" Text='<%# Eval("UnitId") %>'> </asp:Label>
                                                            <asp:Label runat="server" Text='<%# Eval("BirimAdi") %>' ID="Label18"> </asp:Label>
                                                        </ItemTemplate>
                                                        <HeaderStyle Wrap="False" HorizontalAlign="center"></HeaderStyle>
                                                    </asp:TemplateColumn>
                                                    <asp:TemplateColumn HeaderText="<%$ Resources:lang, QtyPrice%>">
                                                        <ItemStyle Wrap="False" HorizontalAlign="Right"></ItemStyle>
                                                        <ItemTemplate>
                                                            <asp:Label runat="server" Text='<%# deger001(Convert.ToDecimal(Eval("Rate").ToString()),Convert.ToDecimal(Eval("Indirim").ToString()),Convert.ToDecimal(Eval("SatisFiyati").ToString()),Convert.ToDecimal(Eval("ValueAdd").ToString()),Convert.ToDecimal(Eval("qty").ToString()),Convert.ToInt32(Eval("ProductId").ToString()))%>'
                                                                ID="Label9" name="Label9"> </asp:Label>
                                                        </ItemTemplate>
                                                        <HeaderStyle Wrap="False" HorizontalAlign="Right"></HeaderStyle>
                                                    </asp:TemplateColumn>
                                                    <asp:BoundColumn DataField="KdvRate" DataFormatString="%{0:0}" HeaderText="<%$ Resources:lang, TaxRate%>">
                                                        <ItemStyle Wrap="False" HorizontalAlign="Right"></ItemStyle>
                                                        <HeaderStyle Wrap="False" HorizontalAlign="Right"></HeaderStyle>
                                                    </asp:BoundColumn>
                                                    <asp:TemplateColumn HeaderText="<%$ Resources:lang, PiceWithoutTax%>">
                                                        <ItemStyle Wrap="False" HorizontalAlign="Right"></ItemStyle>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label12" runat="server" Text='<%# deger002(Convert.ToDecimal(Eval("Rate").ToString()),Convert.ToDecimal(Eval("Indirim").ToString()),Convert.ToDecimal(Eval("SatisFiyati").ToString()),Convert.ToDecimal(Eval("ValueAdd").ToString()),Convert.ToDecimal(Eval("qty").ToString()),Convert.ToInt32(Eval("ProductId").ToString())) %>'> </asp:Label>
                                                        </ItemTemplate>
                                                        <HeaderStyle Wrap="False" HorizontalAlign="Right"></HeaderStyle>
                                                    </asp:TemplateColumn>
                                                    <asp:TemplateColumn HeaderText="<%$ Resources:lang, Selection%>">
                                                        <ItemStyle HorizontalAlign="Justify"></ItemStyle>
                                                        <ItemTemplate>
                                                            <center>
                                                                <asp:CheckBox ID="Remove" runat="server"></asp:CheckBox>
                                                            </center>
                                                        </ItemTemplate>
                                                        <HeaderStyle Wrap="False"></HeaderStyle>
                                                    </asp:TemplateColumn>
                                                    <asp:BoundColumn DataField="Barcode" HeaderText="<%$ Resources:lang, Barcode%>" Visible="false">
                                                    </asp:BoundColumn>
                                                </Columns>
                                            </asp:DataGrid>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div id="stokalert" visible="false" runat="server" class="alert">
                                                <asp:Label ID="lblStokError" runat="Server" EnableViewState="False"></asp:Label></div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:LinkButton ID="lnkUpdate" runat="server" CssClass="savebutton"><%= GetGlobalResourceObject("lang", "Update")%></asp:LinkButton>
                                            <asp:LinkButton ID="lnkDelete" runat="server" CssClass="deletebutton"><%= GetGlobalResourceObject("lang", "Delete")%></asp:LinkButton>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                                <tr>
                                                    <td align="left">
                                                        <asp:DataList ID="dlCargoList" runat="server" RepeatDirection="vertical">
                                                            <HeaderTemplate>
                                                                <b>
                                                                   <%=GetGlobalResourceObject("lang", "ShippingPrice")%></b></HeaderTemplate>
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblCargoName" runat="server" Text='<%# Eval("CargoName") %>'></asp:Label>:
                                                                <asp:Label ID="lblCargoText" runat="server" Text='<%# publicItems.CurrencySymbolLeft + " " + publicItems.formatCurDoviz(Convert.ToDecimal(Eval("CargoPrice").ToString()) * (publicItems.DefaultCurrencyRate /publicItems. CurrencyRate))+ " " + publicItems.CurrencySymbolRight %>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:DataList>
                                                    </td>
                                                    <td align="right">
                                                        <table id="tblfy" cellspacing="0" cellpadding="2" border="0" runat="server">
                                                            <tr>
                                                                <td align="right">
                                                                    <asp:Label ID="lblAgirlik" runat="server" Visible="False"><%=GetGlobalResourceObject("lang", "TotalHeight")%>:</asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:Label ID="lblToplamAgirlik" runat="server" Visible="False"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right">
                                                                    <asp:Label ID="lblHacim" runat="server" Visible="False"><%=GetGlobalResourceObject("lang", "TotalVolume")%>:</asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:Label ID="lblToplamHacim" runat="server" Visible="False"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right">
                                                                    <asp:Label ID="lblIndirim" runat="server" Visible="False"><%=GetGlobalResourceObject("lang", "TotalDiscount")%>:</asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:Label ID="lblToplamIndirim" runat="server" Visible="False"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right">
                                                                    <asp:Label ID="Label2" runat="server"><%=GetGlobalResourceObject("lang", "TotalProductsPrice")%>:</asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:Label ID="lblToplamTutar" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right">
                                                                    <asp:Label ID="Label6" runat="server"><%=GetGlobalResourceObject("lang", "TotalTax")%>:</asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:Label ID="lblToplamKdv" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right">
                                                                    <asp:Label ID="lblAraToplam" runat="server"><%=GetGlobalResourceObject("lang", "SubTotal")%>:</asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:Label ID="lblToplamAraToplam" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right">
                                                                    <asp:Label ID="lblCekTutari" runat="server" Visible="False"><%=GetGlobalResourceObject("lang", "CouponDiscount")%>:</asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:Label ID="lblToplamCekTutari" runat="server" Visible="False"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right" colspan="2">
                                                                    <asp:Label ID="lblSepetSeperator1" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right">
                                                                    <asp:Label ID="Label7" runat="server"><%=GetGlobalResourceObject("lang", "TotalWithTax")%>:</asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:Label ID="lblKdvDahilToplam" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right">
                                                                    <asp:Label ID="lblHavale" runat="server"><%=GetGlobalResourceObject("lang", "TotalWithTransfer")%>:</asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:Label ID="lblKdvDahilHavale" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right">
                                                                    <asp:Label ID="lblKKTek" runat="server"><%=GetGlobalResourceObject("lang", "TotalWithCreditCart")%>:</asp:Label>
                                                                </td>
                                                                <td align="right">
                                                                    <asp:Label ID="lblKdvDahilKK" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="right" colspan="2">
                                                                    <asp:Label ID="lblSepetSeperator2" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <table id="Table6" cellspacing="0" cellpadding="0" width="100%" border="0">
                                <tr>
                                    <td id="Td7" runat="server">
                                    </td>
                                    <td id="Td8" runat="server">
                                    </td>
                                    <td id="Td9" runat="server">
                                    </td>
                                </tr>
                            </table>
                            <table cellpadding="0">
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="btnMailOrder" CssClass="button" runat="server" Visible="False"><%=GetGlobalResourceObject("lang", "Buy")%></asp:LinkButton>
                                    </td>
                                    <td>

                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div id="cartalert" visible="false" runat="server" class="alert">
                                <asp:Label ID="lblcartError" runat="Server" EnableViewState="False"></asp:Label></div>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>

        </asp:UpdatePanel>
4

1 回答 1

0

为什么要在后面的代码中附加事件?尝试更改此行:

<asp:LinkButton ID="lnkDeleteCart" CssClass="deletebutton" runat="server"><%=GetGlobalResourceObject("lang", "Delete")%></asp:LinkButton>

对此:

<asp:LinkButton ID="lnkDeleteCart" CssClass="deletebutton" runat="server" OnClick="lnkDelete_Click"><%=GetGlobalResourceObject("lang", "Delete")%></asp:LinkButton>

并在您的代码隐藏中注释这些行:

EventHandler handler = new EventHandler(this.lnkDelete_Click);

            if (this.lnkDelete != null)
            {
                this.lnkDelete.Click -= handler;
            }

            if (this.lnkDelete != null)
            {
                this.lnkDelete.Click += handler;
            }

我只在删除按钮上进行了更改,您可能也需要更改其他按钮...

于 2013-03-07T14:44:34.347 回答