gpt4 book ai didi

jquery - 看来 JQuery 和 AjaxToolkit 不能一起工作

转载 作者:行者123 更新时间:2023-12-01 03:52:20 25 4
gpt4 key购买 nike

我使用 JQuery 创建了一个很好的工具提示框,并且使用了一些在所有浏览器中都运行良好的插件。但是当我将组件放入更新面板时问题就开始了,我通过显示一些代码来解释这一点:

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:UpdateProgress ID="UpdateProgress0" runat="server">
<ProgressTemplate>
<div style="width: 100%;">
<p>
Please Wait, It is loading...
</p>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<table class="style1">
<tr>
<td align="center">
<asp:Button ID="btnUpBestSale" runat="server" OnClick="btnUpBestSale_Click" Text="▲" />
</td>
</tr>
<tr>
<td>
<div id="demo">
<uc6:GroupLoader ID="GroupLoader1" runat="server" GroupCode="37" ItemCount="5" ItemCountSkipness="0"
RepeatedColumns="1" TypeID="Vertical" />
</div>
<script>
$("#demo img[title]").tooltip({ offset: [30, 25] });
</script>
</td>
</tr>
<tr>
<td align="center">
<asp:Button ID="btnDownBestSale" runat="server" OnClick="btnDownBestSale_Click" Text="▼" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>

当我单击 grouploader 组件内的按钮和行数据绑定(bind)事件时,需要更新面板。

它第一次工作,但单击更新面板内的按钮后,jquery 事件再也不会出现。

我该如何解决这个问题?

最佳答案

请尝试使用此代码。它将确保在 UpdatePanel 中的所有内容更新后执行脚本。 (引用:http://msdn.microsoft.com/en-us/library/bb383810.aspx)

<script>
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function() {
$("#demo img[title]").tooltip({ offset: [30, 25] });
});
</script>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:UpdateProgress ID="UpdateProgress0" runat="server">
<ProgressTemplate>
<div style="width: 100%;">
<p>
Please Wait, It is loading...
</p>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<table class="style1">
<tr>
<td align="center">
<asp:Button ID="btnUpBestSale" runat="server" OnClick="btnUpBestSale_Click" Text="▲" />
</td>
</tr>
<tr>
<td>
<div id="demo">
<uc6:GroupLoader ID="GroupLoader1" runat="server" GroupCode="37" ItemCount="5" ItemCountSkipness="0"
RepeatedColumns="1" TypeID="Vertical" />
</div>
</td>
</tr>
<tr>
<td align="center">
<asp:Button ID="btnDownBestSale" runat="server" OnClick="btnDownBestSale_Click" Text="▼" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>

关于jquery - 看来 JQuery 和 AjaxToolkit 不能一起工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7136782/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com