Page.Master Page.Master Page.Master Page.Master Property

定義

取得決定頁面整體外觀的主版頁面。Gets the master page that determines the overall look of the page.

public:
 property System::Web::UI::MasterPage ^ Master { System::Web::UI::MasterPage ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Web.UI.MasterPage Master { get; }
member this.Master : System.Web.UI.MasterPage
Public ReadOnly Property Master As MasterPage

屬性值

與這個頁面相關聯的 MasterPage (如果存在的話),否則為 nullThe MasterPage associated with this page if it exists; otherwise, null.

備註

Master屬性會傳回MasterPage此頁面相關聯的物件。The Master property returns the MasterPage object associated with this page. 這個屬性是唯讀的;不過,您可以設定屬性上MasterPage物件傳回。This property is read-only; however, you can set properties on the MasterPage object it returns.

Master只能在參考中的主版頁面的頁面上的屬性無效MasterPageFile屬性。The Master property is valid only on pages that reference a master page in the MasterPageFile property. 如果您存取Master並未參考主版頁面的頁面上的屬性null會傳回。If you access the Master property on a page that does not reference a master page, null is returned. 主版頁面的內容不是在之後才能使用PreInit在引發事件。The contents of a master page are not available until after the PreInit event has been raised.

適用於

另請參閱