Page.Master 属性

定义

获取确定页的整体外观的母版页。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; }
[<System.ComponentModel.Browsable(false)>]
member this.Master : System.Web.UI.MasterPage
Public ReadOnly Property Master As MasterPage

属性值

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 属性仅在引用属性中的母版页的页上有效 MasterPageFileThe 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. 在引发事件之前,母版页的内容将不可用 PreInitThe contents of a master page are not available until after the PreInit event has been raised.

适用于

另请参阅