# Region # Add a JS file // <summary> // Add a JS file // The Creator: porschev // Creation Time: 2011-7-25 /// </Summary> /// <Param name = "page"> page </param> /// <Param name = "url"> path </param> public void addscript (system. web. UI. page, string URL) {htmlgenericcontrol jscontrol = new htmlgenericcontrol ("script"); jscontrol. attributes. add ("type", "text/JavaScript"); jscontrol. attributes. add ("src", URL); page. header. controls. add (jscontrol) ;}# endregion # region ## Add a CSS file /// <summary> /// Add a CSS file /// created by posrchev /// creation time: 2011-7-25 /// </Summary> /// <Param name = "page"> page </param> /// <Param name = "url"> path </param> public void addcss (system. web. UI. page, string URL) {htmllink csscontrol = new htmllink (); csscontrol. href = URL; csscontrol. attributes. add ("rel", "stylesheet"); csscontrol. attributes. add ("type", "text/CSS"); page. header. controls. add (csscontrol) ;}# endregion # region ## add meta tag /// <summary> // Add meta tag /// created by: posrchev // Creation Time: 2011-7-25 /// </Summary> /// <Param name = "page"> page </param> /// <Param name = "name"> name </param> /// <Param name = "content"> body </param> Public void addmeta (system. web. UI. page, string name, string content) {system. web. UI. htmlcontrols. htmlmeta = new system. web. UI. htmlcontrols. htmlmeta (); Meta. name = Name; Meta. content = content; page. header. controls. add (Meta) ;}# endregion
Http://www.dtan.so
All three methods can be placed in the public class. If they are directly placed in the page class, the page parameter may not