jQuery calls and Ajax UpdatePanel

Hi, guyz.

In many cases I have found that jQuery code blocks do not work when update panel is there and auto postback does occur.

So in that case here is the solution, just put down below snippet inside script block at end of the page. Note that put your script where I have written bind your jQuery events/calls here initially. And the same you need to register in one ajax event add_endRequest. You can create function here for re-usability instead of writting it two times.!

$(document).ready(function() {
    // bind your jQuery events/calls here initially

var prm = Sys.WebForms.PageRequestManager.getInstance();

prm.add_endRequest(function() {
    // re-bind your jQuery events here



Dynamic jQuery Library loading when jQuery is undefined

Hi Guyz,

Quick Post on loading jQuery library when it is undefined.

Add following snippet on top of the script:

if (typeof(jQuery) == 'undefined') {
   var jq = document.createElement("script");
   jq.type = "text/javascript";
   jq.src = "http://code.jquery.com/jquery-1.9.0.js";

This will load the jQuery from CDN of Google.

Blog more, Help more..!