Page.MasterPageFile Property
.NET Framework 2.0
Gets or sets the file name of the master page.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
'Declaration Public Overridable Property MasterPageFile As String 'Usage Dim instance As Page Dim value As String value = instance.MasterPageFile instance.MasterPageFile = value
/** @property */ public String get_MasterPageFile () /** @property */ public void set_MasterPageFile (String value)
public function get MasterPageFile () : String public function set MasterPageFile (value : String)
Not applicable.
Property Value
The file name of the master page.The MasterPageFile property is the name of the master page file associated with this page. The MasterPageFile property can be set only in the PreInit event; attempting to set the MasterPageFile property after the PreInit event will throw an InvalidOperationException exception.
Pages that have the MasterPageFile property set are content pages, and therefore can contain only top-level controls that are Content controls.
| Topic | Location |
|---|---|
| How to: Reference ASP.NET Master Page Content | Building ASP .NET Web Applications |
| How to: Reference ASP.NET Master Page Content | Building ASP .NET Web Applications |
| How to: Create Content Pages for an ASP.NET Master Page (Visual Studio) | Building ASP .NET Web Applications in Visual Studio |
| How to: Reference ASP.NET Master Page Content |
Community Additions
ADD
Show: