当前位置: 代码迷 >> ASP.NET >> 套用MasterPage的页面,怎么导入CSS样式表
  详细解决方案

套用MasterPage的页面,怎么导入CSS样式表

热度:5571   发布时间:2013-02-25 00:00:00.0
套用MasterPage的页面,如何导入CSS样式表
套用MasterPage的页面,
就 <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>

用 <link href=""/> 页面报错。。

How can I do it?

------解决方案--------------------------------------------------------
HtmlGenericControl script = new HtmlGenericControl("script");
script.Attributes.Add("type", "text/javascript");
script.Attributes.Add("src", ResolveUrl("~/js/jquery.js"));

this.head.Controls.Add(script);

script = new HtmlGenericControl("script");
script.Attributes.Add("type", "text/javascript");
script.Attributes.Add("src", ResolveUrl("~/js/facebox.js"));

this.head.Controls.Add(script);

script = new HtmlGenericControl("script");
script.Attributes.Add("type", "text/javascript");
script.Attributes.Add("src", ResolveUrl("~/js/function.js"));

this.head.Controls.Add(script);

动态直接操作 文件路劲直接写基于更目录的