PagesSection.CompilationMode 属性

定义

获取或设置一个值,该值确定如何编译 .aspx 页和 .ascx 控件。

public:
 property System::Web::UI::CompilationMode CompilationMode { System::Web::UI::CompilationMode get(); void set(System::Web::UI::CompilationMode value); };
[System.Configuration.ConfigurationProperty("compilationMode", DefaultValue=System.Web.UI.CompilationMode.Always)]
public System.Web.UI.CompilationMode CompilationMode { get; set; }
[<System.Configuration.ConfigurationProperty("compilationMode", DefaultValue=System.Web.UI.CompilationMode.Always)>]
member this.CompilationMode : System.Web.UI.CompilationMode with get, set
Public Property CompilationMode As CompilationMode

属性值

CompilationMode 属性的某个值,指定 .aspx 页和 .ascx 控件的编译方式。

属性

示例

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

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

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

' Set the CompilationMode property to CompilationMode.Always.
pagesSection.CompilationMode = CompilationMode.Always

注解

默认值是 Always

适用于

另请参阅