Sys.WebForms.PageRequestManager beginRequest Event
Raised before the processing of an asynchronous postback starts and the postback request is sent to the server.
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler) Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(beginRequestHandler)
The beginRequest event is raised before the processing of an asynchronous postback starts and the postback is sent to the server. You can use this event to call custom script to set a request header or to start an animation that notifies the user that the postback is being processed.
For more information about the PageRequestManager event model, see Working with PageRequestManager Events.
The following example shows how to use the beginRequest function to display a simple progress notification during asynchronous postbacks. The Button1 control invokes the Thread::Sleep method to simulate a long-running process on the server. The Button2 control invokes a server handler that is faster. If you click Button2 while the asynchronous postback from Button1 is still processing, the Button1 postback is canceled.