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';
}

Comments

Popular posts from this blog

How to Convert Word Document to PDF using C#

Loop Through Dates in SQL