Search code examples
jqueryasp.netajaxupdatepanelblockui

Intercept ajax requests with jquery to display BlockUI


i'm trying to intercept ajax requests with jquery, to display a waiting message like with using plugin BlockUI, but how can i intercept requests sended by the UpdatePanel provided from asp.net framework, is some way to take the trigger?

Thanks


Solution

  • You can use the beginRequest and endRequest client side events of the PageRequestManager to display a "please wait" UI.

    Sys.WebForms.PageRequestManager.instance.add_beginRequest(beginRequestHandler)

    Sys.WebForms.PageRequestManager.instance.add_endRequest(endRequestHandler)

    See here for more information. There are examples for each event.