How to register an external js file on the page from asp.net code behind file?

Sheonarayan
Posted by Sheonarayan under ASP.NET category on | Points: 40 | Views : 1811
To register an external js file on the page from asp.net code behind, write following code

this.Page.ClientScript.RegisterClientScriptInclude("key", "/Scripts/MyJsFile.js");


Where the first parameter is the key (can be any string) and the second parameter is the path of the .js file name.

Comments or Responses

Login to post response