Posted on: 10/23/2014 1:34:15 PM | Views : 636

Hello,
I have an ascx user control and two instances of user control on the same aspx page.
I would like to add javascript to manage the postback of a button inside the user control in order to show a waiting icon and disable the button  while execution. 
The following javascript is working well only if there is just one instance of the user control on the page but if there are two or more instances, the javascritpt is executed but in the first instance of the user control created on the page.

The javascript is the following:

// Get the instance of PageRequestManager. var prm = Sys.WebForms.PageRequestManager.getInstance(); // Add initializeRequest and endRequest prm.add_initializeRequest(prm_InitializeRequest); prm.add_endRequest(prm_EndRequest);
// Called when async postback begins function prm_InitializeRequest(sender, args) { // get the divImage and set it to visible ...

Go to the complete details ...