Generic Control to Head of Page


/ Published in: C#
Save to your folder(s)

This adds the tag and its innards to the head of an asp.net document. Can be any tag but this one adds the global.js to the head.


Copy this code and paste it in your HTML
  1. HtmlGenericControl si = new HtmlGenericControl();
  2. si.TagName = "script";
  3. si.Attributes.Add("type", "text/javascript");
  4. si.Attributes.Add("language", "JavaScript");
  5. si.Attributes.Add("src", ResolveClientUrl("~/scripts/global.js"));

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.