468,117 Members | 2,205 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,117 developers. It's quick & easy.

Run Javascript Method after UpdatePanel finishes Updating?

I need to run a Javascript method that I have when an UpdatePanel
finishes updating. (i.e. AFTER the event that triggers it runs)
Can anyone help out with that?

To make it more complicated, the control that I need to do it from is
a UserControl that is loaded into another UserControl that is loaded
into my Default.aspx.
Oct 21 '08 #1
3 7925
So I discovered the EndRequestHandler code that I can use, however
when I do this line of code:

<script type="text/javascript" language="JavaScript">

Sys.WebForms.PageRequestManager.getInstance().add_ endRequest(EndRequestHandler);
</script>

I get "'Sys' is undefined" even though I have everything in my
Web.Config correct according to this page:
http://geekswithblogs.net/ranganh/ar...15/113963.aspx
Oct 21 '08 #2
Turns out that line of code must be called AFTER the Scriptmanager's
declaration.
Oct 21 '08 #3
This should be a good starting point:

<script type="text/javascript">

function onEndRequest(sender, e)
{
// do something ...
}

function onBeginRequest(sender, e)
{
// do something ...
}

Sys.WebForms.PageRequestManager.instance.add_endRe quest(onEndRequest);
Sys.WebForms.PageRequestManager.instance.add_begin Request(onBeginRequest)

</script>

If you are using AjaxControlToolkit you could also utilize
UpdatePanelAnimation.
Hope this helps
--
Milosz
"Pselus" wrote:
I need to run a Javascript method that I have when an UpdatePanel
finishes updating. (i.e. AFTER the event that triggers it runs)
Can anyone help out with that?

To make it more complicated, the control that I need to do it from is
a UserControl that is loaded into another UserControl that is loaded
into my Default.aspx.
Oct 21 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by rodchar | last post: by
reply views Thread by jesper_lofgren | last post: by
4 posts views Thread by faraz | last post: by
4 posts views Thread by Peter | last post: by
4 posts views Thread by Peter | last post: by
8 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.