0

我有这样的东西。。

在母版页上

<head runat="server">
    <link href="../StyleSheets/Main_Master.css" rel="stylesheet" type="text/css" />
    <%--<script type="text/javascript" src="../../Scripts/jquery-1.8.3.js"></script>--%>
    <script src="../../Scripts/Mainmenu.js" type="text/javascript"></script>
    <link href="../../Misc/Plugins/OrbitSlider/orbit-1.2.3.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Misc/Plugins/OrbitSlider/jquery.orbit-1.2.3.min.js"></script>
</head>

内容页

<asp:Content ContentPlaceHolderID="LeftBarHeadContent" runat="server">
    <script src="../../Scripts/jquery-1.8.3.js"></script>
    <link href="../StyleSheets/Home_Content.css" rel="stylesheet" type="text/css" />
    <link href="../StyleSheets/Content_Common.css" rel="stylesheet" />
    <script src="../../Scripts/Contents_Common.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.cycle.all.js" type="text/javascript"></script>
</asp:Content>

现在,这在浏览器上呈现

<head>
<script src="../../Scripts/jquery-1.8.3.js"></script>
        <link href="../StyleSheets/Home_Content.css" rel="stylesheet" type="text/css" />
        <link href="../StyleSheets/Content_Common.css" rel="stylesheet" />
        <script src="../../Scripts/Contents_Common.js" type="text/javascript"></script>
        <script src="../../Scripts/jquery.cycle.all.js" type="text/javascript"></script>
        <link href="../StyleSheets/Main_Master.css" rel="stylesheet" type="text/css" />
        <%--<script type="text/javascript" src="../../Scripts/jquery-1.8.3.js"></script>--%>
        <script src="../../Scripts/Mainmenu.js" type="text/javascript"></script>
        <link href="../../Misc/Plugins/OrbitSlider/orbit-1.2.3.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="../../Misc/Plugins/OrbitSlider/jquery.orbit-1.2.3.min.js"></script>
    </head>

现在,您可以看到内容元素在主内容之前呈现。我需要先加载主内容,因为如果在插件出现之前不包含 jquery,我的一些插件会抛出未定义的 jquery 错误。

4

1 回答 1

3

LeftBarHeadContent您的母版页在哪里?

您需要在母版页中放置类似<asp:contentplaceholder id="LeftBarHeadContent" runat="server" />的内容...<head>

于 2013-01-19T19:17:23.983 回答