Solved

ASP.NET AJAX - send script from server to run immediately on page after partial page postback

Posted on 2011-02-17
1
275 Views
Last Modified: 2012-06-27
I've got an update panel on a page that loads information on a button click.  During the postback to the server I would like to be able to pass a script back down to the client to run as soon as the update panel finishes it's update.

I've tried using this so far in the button click event
ClientScript.RegisterStartupScript(this.GetType(), "HideCustomLoadingIndicator", "HideCustomLoadingIndicator();", true);

But it is not calling the javascript function as I'm wanting it to.  What is the key to making this happen?
0
Comment
Question by:JosephEricDavis
1 Comment
 
LVL 16

Accepted Solution

by:
BurnieP earned 500 total points
ID: 34921698
You should be able using the ScriptManager :

ScriptManager.RegisterStartupScript(Page, this.GetType(), "script", "your script", true);

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 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