Solved

Trying to Launch a Javascript Function after each ASP.net Update Panel Reload

Posted on 2008-10-04
2
457 Views
Last Modified: 2012-05-05
My application has an update panel that displays data based on a user's dropdown selection.
I need to use data from a particular field within the update panel later on in the page.

I need to either launch my function on every refresh of the update panel or find a way to trigger an event (Such as onchange) so that my client-side script can launch accordingly

I am at my wits end and about to do something bad  involving the triggering control control and a half second delay..
Anyways any help will be greatly appreciated- thanks!
0
Comment
Question by:apocalypse910
2 Comments
 
LVL 16

Accepted Solution

by:
anoyes earned 500 total points
ID: 22642940
You can add an endRequest handler in your javascript that will be called each time an update panel finishes its update.  The only catch is that this script has to be after your ScriptManager on the page.

    <script language="javascript">

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

        function RequestCompleted(sender, args)

        {

            alert("Finished AJAX update");

        }

    </script>

Open in new window

0
 

Author Closing Comment

by:apocalypse910
ID: 31503095
That is perfect- thank you so much!!!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now