母版頁的子頁引用css和javascript

在模板頁面:

ContentPlaceHolder控件拖放到<head></head>中間:

 

<asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>

 

在子頁,如a.aspx:

<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">

<link href="a.css" rel="stylesheet" type="text/css" />

<script>

alert('hello word!');

</script>

</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

</asp:Content>

 

 

即可

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章