Mika
Mika

Reputation: 1245

How to know when asp.net ajax request has completed?

I have an asp.net web form with a button, label, scriptmanager and updatepanel controls. When I click the button, the label changes using ajax. How can I detect the change in the label using javascript?

Upvotes: 0

Views: 762

Answers (3)

Adil
Adil

Reputation: 148120

You need to use add_endRequest,

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);

function endRequestHandler(sender, args)
{
     alert("ended");
}

Upvotes: 2

polin
polin

Reputation: 2845

You are using ajax to change or update something on some event. If it changes naturally your output will be changed. If it is some kind of change that doesn't change output but change any attribute then
1. Install firebug addon
2.use it when firing your ajax function.
3. On console mode you will see any change of error which you are expecting from the code

Upvotes: 1

शेखर
शेखर

Reputation: 17614

You can use update progress for this purpose.
Here is a good example for update progress

http://www.devmanuals.com/tutorials/ms/aspdotnet/updateprogress.html

Upvotes: 0

Related Questions