[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2008-10-04
2
Medium Priority
?
465 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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
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…
Suggested Courses

656 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