Solved

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

Posted on 2008-10-04
2
460 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
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…

777 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