看来 JQuery 和 AjaxToolkit 不能一起工作
我使用 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>
当我单击按钮和组加载器组件内的行数据绑定事件时,更新面板是必要的。
它第一次工作,但单击更新面板内的按钮后,jquery 事件再也不会出现。
我该如何解决这个问题?
I have created a nice tooltip box using JQuery and I used some plugin which are works very well in all browser. but the problem is started when I put my component in an update-panel I explain this by show some code :
<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>
The Update panel is necessary when I click on the button and on row data-bind event that is inside my grouploader component.
it work at the first time but after clicking on the button that is inside the update panel jquery event never rise again.
How I can solve this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请尝试使用此代码。它将确保在 UpdatePanel 中的所有内容更新后执行脚本。 (参考:http://msdn.microsoft.com/en-us/library/ bb383810.aspx)
Try this code instead. It will make sure that the script will be executed after everything in UpdatePanel is updated. (Reference: http://msdn.microsoft.com/en-us/library/bb383810.aspx)
从更新面板异步回发后,jquery 将无法工作。因此您必须使用 endrequesthandler,
以下是具体操作方法。
http://codethatworkedforme.blogspot.com/2011/08 /having-issues-with-update-panel.html
jquery wont work after async postback from update panel.so you will have to use endrequesthandler,
Here's how to do it.
http://codethatworkedforme.blogspot.com/2011/08/having-issues-with-update-panel.html