Code & Technology Cocktail
Posts tagged javascript
2
Feb
Sweet you have all kind of cool jQuery on your page (overlayers, tooltips, hovers, …). Then you decide to add an asp:UpdatePanel but after the Update event all your scripts are broken.
We can fix this by executing all code within jQuery(document).ready() everytime the Update event is triggered:
<asp:UpdatePanel runat="server" ID="myUpdatePanel">
<ContentTemplate>
<!-- other code -->
</ContentTemplate>
</asp:UpdatePanel>
<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
documentReady(); //a function which contains all the code within jQuery(document).ready()
});
</script>
By Mike