Ali
Ali

Reputation: 595

calling javascript from ASP.NET when using ajax extention

Well I am using Visual Studio 2010,

If I am not using Ajax extention i.e. if I am not using ScriptManager and UpdatePanel then it is simple task to call a JavaScript function from C# code behind event of any control using "ClientScript.RegisterStartupScript"

But what should be done if my C# code is behind a control inside UpdatePanel and we are using ScriptManager to use Ajax

?!! please advice

Upvotes: 1

Views: 243

Answers (1)

On the button's onclick event:

ScriptManager.RegisterStartupScript(this, this.GetType(), "alertJsTest", "alert('test!');", true);

Upvotes: 1

Related Questions