共用方式為


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

屬性值

應用程式主版頁面的參考。

屬性

範例

下列程式碼範例示範如何使用 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"

備註

此屬性的值可以是相對路徑或絕對路徑。

適用於

另請參閱