<link rel="stylesheet" type="text/css" href="xxx.css">
Page_Load: ControlHelper.AddStyleSheet(this.Page, "css/projectPage.css");
static public class ControlHelper
{
static public void AddStyleSheet(Page page, string cssPath)
{
HtmlLink link = new HtmlLink();
link.Href = cssPath;
link.Attributes["rel"] = "stylesheet";
link.Attributes["type"] = "text/css";
Page.Header.Controls.Add(link);
}
}
沒有留言:
張貼留言