PagesSection.MasterPageFile 属性

定义

获取或设置对应用程序母版页的引用。

public:
 property System::String ^ MasterPageFile { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("masterPageFile", DefaultValue="")]
public string MasterPageFile { get; set; }
[<System.Configuration.ConfigurationProperty("masterPageFile", DefaultValue="")>]
member this.MasterPageFile : string with get, set
Public Property MasterPageFile As String

属性值

String

一个对应用程序母版页的引用。

属性

示例

下面的代码示例说明如何使用 MasterPageFile 属性。

// Get the current MasterPageFile property value.
Console.WriteLine(
    "Current MasterPageFile value: '{0}'",
    pagesSection.MasterPageFile);

// Set the MasterPageFile property to "MyMasterPage.ascx".
pagesSection.MasterPageFile = "MyMasterPage.ascx";
' Get the current MasterPageFile property value.
Console.WriteLine( _
    "Current MasterPageFile value: '{0}'", _
    pagesSection.MasterPageFile)

' Set the MasterPageFile property to "MyMasterPage.ascx".
pagesSection.MasterPageFile = "MyMasterPage.ascx"

注解

此属性的值可以是相对路径,也可以是绝对路径。

适用于

另请参阅