Sunday, March 11, 2012

Is possible to make the updatePanel call a javascript function after a run trip through th

Sys.WebForms.PageRequestManager.getInstance().add_endRequest([function]);

BUT there is a way to do it in server side? because I would like to do it only if the page is not postback.

thanks.


Making a JavaScript call "after a round trip to the server" and "do it only if the page is not postback" are mutually exclusive. What exactly is it that you're trying to do?


Thank you very much for the post gt329a. What I'm trying to do is similar when we use a webservice through ajax. When we call a webservice the page wait for the answer, and when it comes he execute the function that we had explecit like the usual name OnComplete. I need that when the updatePanel complete his run trip through the server that he execute a javascript code and execute it only once. The method I had mentioned in the post above has a problem that he adds the event one after another, beside of replace the events with the same names, so when the updatePanel execute twice the event is also executed twice, because he was added twice, that's why I was wondering if I could add this event in server side.

I didn't know that the updatePanel don't load the body again even with possible change of appearance. So I solved that inserting the method Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function) in the body load. zzZZzZzzZzzZZZzzZZZzzZZ

Thank you anyway. =D

No comments:

Post a Comment