HttpRuntimeSection.EnableVersionHeader Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets a value that indicates whether ASP.NET should output a version header.

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

[ConfigurationPropertyAttribute("enableVersionHeader", DefaultValue = true)]
public bool EnableVersionHeader { get; set; }

Property Value

Type: System.Boolean

true if the output of the version header is enabled; otherwise, false. The default value is true.

This attribute is used by Visual Studio to determine which version of ASP.NET is in use. It is not necessary for production sites and can be disabled.

The following example shows how to use the EnableVersionHeader property.

// Get the EnableVersionHeader property value.
Response.Write("EnableVersionHeader: " +
  configSection.EnableVersionHeader + "<br>");

// Set the EnableVersionHeader property value to false
configSection.EnableVersionHeader = false;

.NET Framework
Available since 2.0
Return to top
Show: