Here is the addition of CSS, JS, meta tags from the ASP, we write a function here for later use. If the function is placed in a page class, it is also possible to do so by page parameters.
First import namespaces using System.Web.UI.HtmlControls;
<summary>///Add JS script links///</summary>//<param name= "page" > page </param>/ <param name= "url" > Path </param> public void Addjs (System.Web.UI.Page Page, string url) { HtmlGenericControl Jscontrol = new HtmlGenericControl ("script"); JSCONTROL.ATTRIBUTES.ADD ("type", "Text/javascript"); JSCONTROL.ATTRIBUTES.ADD ("src", url); Page. HEADER.CONTROLS.ADD (Jscontrol); }///<summary>///Add JS script content///</summary>//<param name= "page" > pages </pa ram>//<param name= "Content" > Script content </param> public void Addscript (System.Web.UI.Page page, s Tring content) {HtmlGenericControl ScriptControl = new HtmlGenericControl ("script"); SCRIPTCONTROL.ATTRIBUTES.ADD ("type", "Text/javascript"); scriptcontrol.innerhtml = content; Page. Header.cOntrols. ADD (ScriptControl); }///<summary>///Add CSS style links///</summary>//<param name= "page" > pages </p aram>//<param name= "url" > Path </param> public void Addcss (System.Web.UI.Page Page, string ur L) {Htmllink link = new Htmllink (); Link. Href = URL; Link. Attributes.Add ("rel", "stylesheet"); Link. Attributes.Add ("type", "text/css"); Page. HEADER.CONTROLS.ADD (link); }///<summary>///Add CSS style content///</summary>//<param name= "page" > pages </p aram>//<param name= "content" > Style content </param> public void Addstyle (System.Web.UI.Page page, s Tring content) {HtmlGenericControl Stylecontrol = new HtmlGenericControl ("style"); STYLECONTROL.ATTRIBUTES.ADD ("type", "text/css"); stylecontrol.innerhtml = content; Page. HEADER.CONTROLS.ADD (Stylecontrol); }///<summary>///Add META tags///</summary>//<param name= "page" > pages </pa ram>//<param name= "name" >meta name </param>///<param name= "content" >meta contents </PARAM&G T public void Addmeta (System.Web.UI.Page Page, string name, string content) {Htmlmeta meta = new Html Meta (); Meta. name = name; Meta. Content = content; Page. HEADER.CONTROLS.ADD (meta); }