Link to home
Start Free TrialLog in
Avatar of JosephEricDavis
JosephEricDavis

asked on

ASP.NET - Register Startup Script from a postback inside an update panel.

I have a situation where I have a button inside of an update panel.  When the button is clicked it triggers a partial page postback.  In the code behind of that partial page postback I am trying to register a client startup script based on logic that is running in the server side click event.  The code I'm trying to use to do this is...

ClientScript.RegisterStartupScript(this.GetType(), "Displayt36SaveDetailsCompleteMessage", "Displayt36SaveDetailsCompleteMessage();", true);

But when the partial page postback completes, this code is not being run.  Is there a way I can register a script in the code behind of a partial page postback of an update panel and have that script run as soon as the update panel finishes the postback?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Member_2_4913559
Member_2_4913559
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok try this instead:
ScriptManager.RegisterStartupScript(this.YourUpdatePanelId, typeof(string), "Displayt36SaveDetailsCompleteMessage", "Displayt36SaveDetailsCompleteMessage();", true);

Open in new window


Reference:
http://msdn.microsoft.com/en-us/library/bb310408.aspx
Oops sorry, the correct reference for that method is:
http://msdn.microsoft.com/en-us/library/bb359558.aspx