Solved

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

Posted on 2008-10-04
2
461 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…

730 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