母版页不抓取 contentPlaceHolder 的样式

Master Page doesn't grab styling for contentPlaceHolder

这是我第一次使用内容。 我创建了一个包含所有样式等的完整 aspx 页面,所有 styling/bootstrap 等看起来像这样:

使用第一页作为参考,我将代码从中分离出来并将其复制到母版页中,并将所有导航栏代码移动到 Default.aspx 页面中。

当我创建内容母版并添加代码时,它显示如下:

我不确定为什么没有显示样式等。一定是组织错了什么?

我什至尝试将 css 直接添加到 Master 中,但仍然 css 不起作用。

<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site1.master.vb" Inherits="CherylsGroupWeb.Site1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<!-- Latest compiled and minified CSS -->
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet nofollow" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
<!-- jQuery library -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
<link href="Index.css" rel="stylesheet" type="text/css" />    
<script type="text/javascript">
    $(document).ready(function () {
        $('#menu-content li').click(function () {
            $('#menu-content .active').removeClass('active'); // remove the class from the currently selected
            $(this).addClass('active'); // add the class to the newly clicked link
        });     
</script>

<style>
   <!-- put all css here to test as well -->
</style>

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

</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>

    <asp:ContentPlaceHolder ID="topContent" runat="server">
           <a href="Default.aspx">Master Pages Tutorials</a>

    </asp:ContentPlaceHolder>

    <asp:ContentPlaceHolder ID="MainContent" runat="server">

    </asp:ContentPlaceHolder>

</div>
</form>
</body>
</html>

我不确定我的格式究竟是什么错误,但是通过将示例的结构复制到一个新的 Master 中并在我的 Default.aspx 周围添加内容,它显示了它。所以我为 Default.aspx

删除了 <a>

Default.aspx

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="GroupWeb._Default1" MasterPageFile="~/Site2.Master" %>


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

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="topContent" runat="server">
        <!-- my nav bar code --->
</asp:Content>

硕士

<body>
<form id="form1" runat="server">
<div id='mainBody'>
<h1>
    How to use Master Pages in ASP.NET
</h1>
<br />
<b>This is a Master Page Content.</b>
<br />
<br />
<div>

    <asp:ContentPlaceHolder ID="topContent" runat="server">

    </asp:ContentPlaceHolder>
    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
    <!-- ContentPlaceHolder is used to enable the pages which uses this page as master page, to place their contents -->
    </asp:ContentPlaceHolder>
</div>
</div>
</form>
</body>