日期:2014-05-18  浏览次数:20469 次

套用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);

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