System.Web.UI.Page.ClientTarget Property

Gets or sets a value that allows you to override automatic detection of browser capabilities and to specify how a page is rendered for particular browser clients.

Syntax

[System.ComponentModel.DefaultValue("")]
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
public string ClientTarget { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

If you do not set the Page.ClientTarget property, the System.Web.HttpBrowserCapabilities object associated with the Page.Request property reflects the capabilities of the client browser. If you do set this property, client browser detection is disabled and the page will use browser capabilities associated with the value (alias) that you provide.

The root Web.config configuration file on the Web server computer defines the following default aliases that you can use as shorthand for common user-agent strings:

  • uplevel, which specifies browser capabilities equivalent to Internet Explorer 6.0.

  • downlevel, which specifies browser capabilities equivalent to older browsers that do not support client script. You can use this alias to determine how Web pages would work in a browser that has client script disabled.

You can set the alias programmatically using this property, or you can set it declaratively using the ClientTarget attribute of the @ Page directive.

You can define additional aliases in the clientTarget section of the application-level Web.config file. For more information, see clientTarget Element (ASP.NET Settings Schema).

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0