Skip to content

Instantly share code, notes, and snippets.

@OzieWest
Created June 23, 2014 06:26
Show Gist options
  • Select an option

  • Save OzieWest/aff3190b7f7615b97e35 to your computer and use it in GitHub Desktop.

Select an option

Save OzieWest/aff3190b7f7615b97e35 to your computer and use it in GitHub Desktop.
Dynamically adding js to ASP.NET
var js = new HtmlGenericControl("script");
js.Attributes["type"] = "text/javascript";
js.Attributes["src"] = "myFile.js";
Page.Header.Controls.Add(js);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment