Add javascript via c# code behind in .net webforms project

You can call a javascript function in the codebehind of a webforms project. Its important not to forget the semi-colon after the function name.

Page.ClientScript.RegisterStartupScript(this.GetType(), "Call My Javascript Function", "myJavaScriptFunction();", true);

Leave a Reply