# Region # Add a JS File
/// <Summary>
/// Add a JS File
/// Created by 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 a meta tag
/// <Summary>
/// Add a 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 meta = new system. Web. UI. htmlcontrols. htmlmeta ();
Meta. Name = Name;
Meta. content = content;
Page. header. Controls. Add (Meta );
}
# Endregion
All three methods can be placed in the public class. If they are directly placed in the page class, the page parameter may not