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.
Assembly: System.Web (in System.Web.dll)
'Declaration <BrowsableAttribute(False)> _ Public Property ClientTarget As String 'Usage Dim instance As Page Dim value As String value = instance.ClientTarget instance.ClientTarget = value
If you do not set the 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 root Web.config configuration file on the 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 Web.config file 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 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>
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.