PagesSection.CompilationMode 属性

定义

获取或设置一个值,该值确定如何编译 .aspx 页和 .ascx 控件。Gets or sets a value that determines how .aspx pages and .ascx controls are compiled.

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

属性值

CompilationMode 属性的某个值,指定 .aspx 页和 .ascx 控件的编译方式。One of the values for the CompilationMode property, which specifies how .aspx pages and .ascx controls are compiled.

属性

示例

下面的代码示例说明如何使用 CompilationMode 属性。The following code example shows how to use the CompilationMode property.

// 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

注解

默认值是 AlwaysThe default value is Always.

适用于

另请参阅