Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CompilationMode Property

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)

'Declaration
<ConfigurationPropertyAttribute("compilationMode", DefaultValue := CompilationMode.Always)> _
Public Property CompilationMode As CompilationMode

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.
Console.WriteLine( _
    "Current CompilationMode value: '{0}'", _
    pagesSection.CompilationMode)

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft