Assembly: System.Web (in system.web.dll)
/** @property */ public String get_ClientTarget () /** @property */ public void set_ClientTarget (String value)
public function get ClientTarget () : String public function set ClientTarget (value : String)
Property ValueA String that specifies the browser capabilities that you want to override.
If you do not set the ClientTarget property, the 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 named alias. In particular, each alias has a user-agent definition.
The configuration file (Web.config) on your Web server computer defines four default aliases you can use as shorthand for common user agent strings. These defaults are ie5, which allows you to customize pages for Microsoft Internet Explorer 5.5 browsers, ie4, which allows you to customize pages for Internet Explorer 4.0 browsers, uplevel, which allows you to customize pages for Internet Explorer 4.0 and later, and downlevel, which allows you to customize pages for browsers earlier than Internet Explorer 4.0.
You can set the alias string programmatically using this property, or you can set it declaratively using the @ Page directive's ClientTarget attribute. If you want to customize the response that a page sends to browsers beyond the four defaults, define a new alias in the <clientTarget> section of the application-level configuration file (Web.config) and then set this property to that alias. For more information, see ASP.NET Configuration Overview.
The following code example defines an
ie302 alias and includes sections needed to configure your application in its Web.config file. Using this alias, you can set the ClientTarget property to
ie302 and customize pages specifically for Internet Explorer 3.02 browsers.
<configuration> <system.web> <clientTarget> <add alias="ie302" useragent="Mozilla/2.0 (compatible; MSIE 3.02; Windows NT 3.5)" /> </clientTarget> </system.web> </configuration>