Redigera

Dela via


ClientTarget.Alias Property

Definition

Gets the user agent's alias.

public:
 property System::String ^ Alias { System::String ^ get(); };
[System.Configuration.ConfigurationProperty("alias", IsKey=true, IsRequired=true)]
[System.Configuration.StringValidator(MinLength=1)]
public string Alias { get; }
[<System.Configuration.ConfigurationProperty("alias", IsKey=true, IsRequired=true)>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.Alias : string
Public ReadOnly Property Alias As String

Property Value

The name used to refer to a specific user agent.

Attributes

Examples

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",
      alias);
' Get the first client target 
' in the collection.
clientTarget = clientTargets(0)

' Get the alias.
aliasStr = clientTarget.Alias

msg = String.Format( _
"Alias:      {0}" + ControlChars.Lf, aliasStr)

Remarks

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.

Applies to

See also