ASP.NET 2.0入门经典2(19)
发布时间:2021-06-06
发布时间:2021-06-06
ASP.NET入门经典
每个占位符都必须有自己的ID,如下例所示:
<%@ Master Language="VB" %>
<html><body>
<form id="form1" runat="server">
<asp:contentplaceholder runat="server" id="TopContent" />
<asp:contentplaceholder runat="server" id="MiddleContent" />
<asp:contentplaceholder runat="server" id="BottomContent" />
</form>
</body></html>
接下来就可以将内容包含在<asp:content>标记中,这些标记的ContentPlaceHolderID值与Master页面中的ID值相等:
<%@ Page Language="VB"MasterPageFile="~/research.master"Title="Untitled Page"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TopContent" Runat="Server">
Text to go in Top section
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MiddleContent" Runat="Server">
Text to go in Middle section
</asp:Content>
<asp:Content ID="Content1"ContentPlaceHolderID="BottomContent"Runat="Server">
Text to go in Bottom section
上一篇:初三语文第一学期期末试卷(二)
下一篇:第四章 市场营销环境