JS可以這樣加載:<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"> <Scripts> <asp:ScriptReference Path="/Js/jquery.timers-1.2.js" /> </Scripts></asp:ScriptManagerProxy>這樣會(huì)自動(dòng)加在頁面中的<head></head>標(biāo)簽中。 如何在控件中加載特定的CSS文件也加載到生成頁面的<head></head>標(biāo)簽中?
2 回答

慕工程0101907
TA貢獻(xiàn)1887條經(jīng)驗(yàn) 獲得超5個(gè)贊
public partial class DropDownSelect : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.Page.Header.Controls.Add(new LiteralControl("<link href=\"WOODY-WU.css\" type=\"text/css\" rel=\"stylesheet\" />"));
加入紅色的就可以在目標(biāo)頁引入CSS
- 2 回答
- 0 關(guān)注
- 719 瀏覽
添加回答
舉報(bào)
0/150
提交
取消