ClientTarget.Alias 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取用户代理的别名。
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
属性值
用于引用特定用户代理的名称。
- 属性
示例
下面的代码示例演示如何从现有 Web 应用程序的配置文件中获取 Alias 该配置文件。
// 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)
注解
该Alias属性引用alias
配置文件节中clientTarget
元素的属性add
。
ASP.NET 配置默认值包括以下别名:
uplevel
,指示 ASP.NET 发送 Internet Explorer 6.0 及更高版本支持的 HTML 和 ECMAScript。downlevel
,它告知 ASP.NET 将 HTML 和脚本限制为早于 Internet Explorer 6.0 的浏览器支持的版本。