Jump to content

Call a javascript function after an UpdatePanel asynchronous postback

Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Call a javascript function after an UpdatePanel asynchronous postback Rate Topic: -----

#1 User is offline   Catalyst 

  • Codesmith
  • Group: Administrators
  • Posts: 1,049
  • Joined: 04-April 06
  • Gender:Male
  • Location:San Diego

Posted 26 March 2007 - 07:40 AM

After spending a lot of time looking around for a way to call a function after an UpdatePanel completes its asynch postback I found that most of the advice revolved around using the Page.ClientScript.RegisterStartupScript function which I just couldn't get working and wasn't excited about in the first place.

Eventually I found the following javascript syntax which was much easier and works great

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


where foo() is the function you want called after the postback is complete. My need for it was that I'm using thickbox to show the contents of the UpdatePanel but the panel was being rendered by thickbox before it was updated, thus it was always behind by one update.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users