Monday, October 11, 2010

Executing Client Java Scripts before and after Ajax Postback

Use following script to execute Javascript before / after Ajax postback

< language="javascript" type="text/javascript">

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);

function InitializeRequest(sender, args) {
alert('Before Postback');
}

function EndRequest(sender, args) {
//document.getElementById("Label2").innerHTML = "Before Postback";
alert('After Postback');
}


End Script

No comments:

Post a Comment