我正在尝试与母版页上的其他页面进行通信,但是我认为出了点问题。跳转到页面后出现错误
母版页
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light " style="background-color:#aea5f7">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo01">
<a class="navbar-brand text-white" href="#">Hidden brand</a>
<ul class="navbar-nav mr-auto mt-2 mt-lg-0 ">
<li class="nav-item active">
<a class="nav-link text-white" href="#">About Us <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link text-white" href="#">Products</a>
</li>
<li class="nav-item">
<a class="nav-link disabled text-white" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<ul class="form-inline navbar-nav my-2 my-lg-0">
<li class="nav-item">
<a class="nav-link text-white" href='<%= Page.ResolveUrl("~/login.aspx") %>'>Login</a>
</li>
<li class="nav-item">
<a class="nav-link text-white " href='<%= Page.ResolveUrl("~/registartion.aspx") %>'>SignUp</a>
</li>
</ul>
</div>
</nav>
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>
子页面
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="loginRegistration.login" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<div class="col-lg-6">
<h1>LogIn</h1>
<form id="form1" runat="server">
Name
<asp:TextBox ID="name" class="form-control" AutoPostBack="true" runat="server" ></asp:TextBox>
Email
<asp:TextBox ID="email" class="form-control" runat="server" ></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" class="btn btn-primary btn-sm" Text="Save" />
<asp:Button ID="Button2" runat="server" class="btn btn-primary btn-sm" Text="Update" />
<asp:Label ID="saved" runat="server"></asp:Label>
</form>
</div>
</asp:Content>
Cannot find ContentPlaceHolder 'MainContent' in the master page '/Site.master', verify content control's ContentPlaceHolderID attribute in the content page
[HttpException (0x80004005): Cannot find ContentPlaceHolder 'MainContent' in the master page '/Site.master', verify content control's ContentPlaceHolderID attribute in the content page.]
System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +1458
System.Web.UI.Page.get_Master() +116
System.Web.UI.Page.ApplyMasterPage() +54
System.Web.UI.Page.PerformPreInit() +83
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1910