asp:Content ID=Content1 ContentPlaceHolderID=ContentPlaceHolder3Runat=Server/asp:Content是什么?

asp:Content ID=Content1 ContentPlaceHolderID=ContentPlaceHolder3Runat=Server/asp:Content是什么?

这是内容页里的代码。它使用了母版页.master。在母版页里使用了

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

进行了占位,在这里添加内容页里比母版页多出的部分。内容页里的<asp:content runat="server" ...>中的ContentPlaceHolderID属性的值必需是母版页里的ContentPlaceHolderID的属性值的任何一个。
比如你定义了母板页MasterPage.master,那么内容页里的是<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="mystest2.aspx.cs" Inherits="mystest2" Title="无标题页" %>

分类: ASP.NET

posted @ 2019-10-04 13:26  grj001  阅读(119)  评论(0编辑  收藏  举报