<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <input src="../../../images/ico/ico_delete.gif" onload="reBindDatepicker()" style="display: none" id="Image1" type="image" /> </ContentTemplate> </asp:UpdatePanel>
<script type="text/javascript"> function reBindDatepicker() { $(document).ready(function() { //... }); } </script>
注意: src 地址要写正确
----------------
第二种方法:
$(document).ready(function() { // bind your jQuery events here initially }); var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(function() { // re-bind your jQuery events here }); the solution is from : http://stackoverflow.com/questions/256195/jquery-document-ready-and-updatepanels
本文探讨了在ASP.NET AJAX UpdatePanel中使用jQuery进行事件绑定的两种方法,包括如何在页面加载时和异步更新后重新绑定事件,确保DOM元素上的事件监听器正常工作。
1376

被折叠的 条评论
为什么被折叠?



