Posted By

ad5qa on 01/14/08


Tagged

c aspnet


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


Generic Control to Head of Page


 / Published in: C#
 

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.

  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  

You need to login to post a comment.