RazorPagesOptions.AllowAreas RazorPagesOptions.AllowAreas RazorPagesOptions.AllowAreas Property

Definition

Gets or sets a value that determines if areas are enabled for Razor Pages. Defaults to false.

public bool AllowAreas { get; set; }
member this.AllowAreas : bool with get, set
Public Property AllowAreas As Boolean

Property Value

Remarks

When enabled, any Razor Page under the directory structure /Area/AreaName/Pages/ will be associated with an area with the name AreaName.

This property is associated with a compatibility switch and can provide a different behavior depending on the configured compatibility version for the application. See CompatibilityVersion for guidance and examples of setting the application's compatibility version.

Configuring the desired of the value compatibility switch by calling this property's setter will take precedence over the value implied by the application's CompatibilityVersion.

If the application's compatibility version is set to Version_2_0 then this setting will have value false unless explicitly configured.

If the application's compatibility version is set to Version_2_1 or higher then this setting will have value true unless explicitly configured.

Applies to