SolutionCottage.com
Posted  20 Jan 2009 - 22:13:00

Category: ASP.net


ClientScript.RegisterStartupScript does not execute code

Issue:
You are using ClientScript.RegisterStartupScript to register a script on a page with UpdatePanel using ASP.net AJAX.

Solution:
Use the ScriptManager! Something like this:

ScriptManager.RegisterStartupScript(this.updatePanel, typeof(string), "alertPopup", "alert('JavaScript!');", true);



Marked as helpful by 9 users




4 comments:

9/10/2012 5:51:55 PM  hy  wrote:

thanks!!!


5/18/2011 4:15:38 PM  Vladzeem  wrote:

Thanks a lot - saved me tons of time


2/3/2011 4:29:53 PM  Simon Olesen  wrote:

thanks, saved my day...


1/27/2010 3:42:16 AM  Christian Godi  wrote:

good one...works perfect









© SolutionCottage 2008-2011 9/26/2017 10:16:23 AM