PagesSection.CompilationMode Property


Gets or sets a value that determines how .aspx pages and .ascx controls are compiled.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

[ConfigurationPropertyAttribute("compilationMode", DefaultValue = CompilationMode.Always)]
public CompilationMode CompilationMode { get; set; }

Property Value

Type: System.Web.UI.CompilationMode

One of the values for the CompilationMode property, which specifies how .aspx pages and .ascx controls are compiled.

The default value is Always.

The following code example shows how to use the CompilationMode property.

// Get the current CompilationMode property value.
    "Current CompilationMode value: '{0}'",

// Set the CompilationMode property to CompilationMode.Always.
pagesSection.CompilationMode = CompilationMode.Always;

.NET Framework
Available since 2.0
Return to top