473,387 Members | 1,529 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 8101
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: rodchar | last post by:
hey all, why doesn't my javascript init method run after the updatepanel has been updated? it runs initially when i start the application but i need it to run when something is clicked inside an...
0
by: jesper_lofgren | last post by:
Hello, I have a asp:updatepanel where i have a javascript that should run when a special event accour in the code. I use registerclientscriptblock method to add the javascript. Everything works...
1
by: podpi | last post by:
Hello I'm having a bit of a proooblem. I have a gridview which has a checkbox as one of the templatecolumn's. When it is checked, it hides a textbox containing a DateTime templatefield...
1
by: gabe | last post by:
How do you call a client side javascript callback method after an update panel has posted back to the server? I have two update panels (A + B) with a gridview in each panel. GridView B has a...
4
by: faraz | last post by:
I have a javascript function that i want to call masterpage load method called. I cant add onLoad event of body or table in master page. I have put the call to script function in <form>, it...
2
by: baburk | last post by:
Hi all, when I call the javascript method from code behind file of the same page it works fine. ScriptManager.RegisterClientScriptBlock(this, Page.GetType(), "Scroll",...
4
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
4
by: pechar | last post by:
Hi All, This question has been asked many times and I've checked most of the sites with resolutions. None worked for me. 1) I have a page which is a content page to a Masterpage . 2) I have a...
4
by: Peter | last post by:
I have a DataList and each item in the datalist has an imge, I want to change the datalist item image on the client side when user clicks a button. How would I do that with JavaScript, does anyone...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.