ClientTarget.Alias Property


Gets the user agent's alias.

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

[ConfigurationPropertyAttribute("alias", IsRequired = true, IsKey = true)]
[StringValidatorAttribute(MinLength = 1)]
public string Alias { get; }

Property Value

Type: System.String

The name used to refer to a specific user agent.

The Alias property refers to the alias attribute of the add element in the clientTarget section of the configuration file.

The ASP.NET configuration defaults include the following aliases:

  • uplevel, which tells ASP.NET to send HTML and ECMAScript that is supported by Internet Explorer 6.0 and later versions.

  • downlevel, which tells ASP.NET to limit the HTML and script to the versions that are supported by browsers earlier than Internet Explorer 6.0.

The following code example shows how to get the Alias from the configuration file of an existing Web application.

// Get the first client target 
// in the collection.
clientTarget = clientTargets[0];

// Get the alias.
alias = clientTarget.Alias;

msg = String.Format(
      "Alias:      {0}\n",

.NET Framework
Available since 2.0
Return to top