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.

備註

屬性會傳回與MasterPage此頁面相關聯的物件。 MasterThe 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.

屬性只有在參考MasterPageFile屬性主版頁面的頁面上才有效。 MasterThe 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.

適用於

另請參閱