To Handle asynchronous clicks in Update Panels
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);
var postBackElement;
function InitializeRequest(sender, args)
{
if (prm.get_isInAsyncPostBack())
args.set_cancel(true);
postBackElement = args.get_postBackElement();
if(document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1')!=null)
document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1').style.display = 'block';
}
function EndRequest(sender, args)
{
if(document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1')!=null)
document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1').style.display = 'none';
}
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);
var postBackElement;
function InitializeRequest(sender, args)
{
if (prm.get_isInAsyncPostBack())
args.set_cancel(true);
postBackElement = args.get_postBackElement();
if(document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1')!=null)
document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1').style.display = 'block';
}
function EndRequest(sender, args)
{
if(document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1')!=null)
document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1').style.display = 'none';
}
Comments
Post a Comment