MasterPage.Master プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > MasterPage.Master プロパティの意味・解説 

MasterPage.Master プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

入れ子になったマスタ ページ現在のマスタの親マスタ ページ取得します

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

解説解説
使用例使用例

このセクションには、3 つのコード例含まれています。最初コード例では、入れ子になったマスタ ページ作成します2 番目のコード例では、最初コード例作成したマスタ ページ参照する方法示します3 番目のコード例では、コンテンツ ページ使用して2 番目のコード例作成したマスタ ページ参照する方法示します

入れ子になったマスタ ページ作成する方法次のコード例示します。この例は、ParentMasterPage_1 という名前の親マスタ ページ表してます。

<%@ Master Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html  >
<head runat="server">
    <title>Nested Master Page Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <h1>This is content in the parent master page.</h1>
    <div>
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
    </div>
    </form>
</body>
</html>
<%@ Master Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html  >
<head runat="server">
    <title>Nested Master Page Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <h1>This is content in the parent
 master page.</h1>
    <div>
        <asp:contentplaceholder id="ContentPlaceHolder1"
 runat="server">
        </asp:contentplaceholder>
    </div>
    </form>
</body>
</html>

前述コード例作成したマスタ ページ参照するChildMasterPage_1 という名前の入れ子になったマスタ ページ使用する方法次のコード例示します

<%@ Master Language="C#" MasterPageFile="~/ParentMasterPage_1cs.master"
 %>

<asp:Content Runat="Server" ContentPlaceHolderID="ContentPlaceHolder1">
    <h2>This is the content of a nested Master Page.</h2>
    <div>
        <asp:contentplaceholder id="ContentPlaceHolder2" runat="server">
        </asp:contentplaceholder>
    </div>
</asp:Content>
<%@ Master Language="VB" MasterPageFile="~/ParentMasterPage_1vb.master"
 %>

<asp:Content Runat="Server" ContentPlaceHolderID="ContentPlaceHolder1">
    <h2>This is the content of a nested
 Master Page.</h2>
    <div>
        <asp:contentplaceholder id="ContentPlaceHolder2"
 runat="server">
        </asp:contentplaceholder>
    </div>
</asp:Content>

前述コード例作成した ChildMasterPage_1参照するContentPage という名前のコンテンツ ページ使用する方法次のコード例示します

<%@ Page Language="C#" MasterPageFile="~/ChildMasterPage_1cs.master"
 Title="Untitled Page"%>

<asp:content runat="server" contentplaceholderid="ContentPlaceHolder2">
This is the content of a Content control.
</asp:content>
<%@ Page Language="VB" MasterPageFile="~/ChildMasterPage_1vb.master"
 Title="Untitled Page"%>

<asp:content runat="server" contentplaceholderid="ContentPlaceHolder2">
This is the content of a Content control.
</asp:content>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「MasterPage.Master プロパティ」の関連用語

MasterPage.Master プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



MasterPage.Master プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS