Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

728 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