2

Im using updatePanel and after postback which updates it I would like to add some javascript to the page which would execut after all javascript run which is specified on

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

Thanks for any hint how to do that

1
  • Add the JS <script> block to the update panel code in VB/C#? Commented May 24, 2011 at 14:33

3 Answers 3

0
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(){
    MyJSFunc.apply(this, arguments);
    MyJSFuncAfterEndRequestFunc.apply(this, arguments);
});
Sign up to request clarification or add additional context in comments.

2 Comments

I dont really understad. Im using server siode methods to get set of point which after updatePanel is updated are shown on the google map on my site. Im using javascript to add markers to google map but want to generate that set of points on server side and then pass it to the site
So you could output the set of points as a json object, or in a hidden field, or as data- attributes, etc. Then MyJSFuncAfterEndRequestFunc would pick it up and process.
0

Have a look at the ScriptManager.RegisterClientScriptBlock Method. With this you can add in javascript to your page after the postback.

Comments

0

I had a similar question the other day, Execute JQuery after ASP.Net Microsoft AJAX

I think the answer provided by trelston is what you are looking for.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.