MasterPage.Master Property

Gets the parent master page of the current master in nested master pages scenarios.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

public:
property MasterPage^ Master {
	MasterPage^ get ();
}
/** @property */
public MasterPage get_Master ()

public function get Master () : MasterPage

Not applicable.

Property Value

The master page that is the parent of the current master page; otherwise, a null reference (Nothing in Visual Basic), if the current master page has no parent.

The Master property is read-only, because master page hierarchies cannot be built at run time.

This section contains three code examples. The first code example demonstrates how to create a nested master page. The second code example demonstrates how to reference the master page that was created in the first code example. The third code example demonstrates how to use a content page to reference the master page that was created in the second code example.

The following code example demonstrates how to create a nested master page and represents the parent master page named ParentMasterPage_1.

No code example is currently available or this language may not be supported.

The following code example demonstrates how to use a nested master page named ChildMasterPage_1 that references the master page that was created in the preceding code example.

No code example is currently available or this language may not be supported.

The following code example demonstrates how to use a content page named ContentPage that references the ChildMasterPage_1 that was created in the preceding code example.

No code example is currently available or this language may not be supported.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: