This code will insert a specified tag into the webpage programatically.
public static void GenerateJsTag(this TemplateControl page, string jsCode) { var jsLink = new HtmlGenericControl {TagName = "script", InnerHtml = jsCode }; jsLink.Attributes.Add("type", "text/javascript"); page.Controls.Add(jsLink); }
No comments:
Post a Comment