System.Web.UI Namespace Page Class
Sets or retrieves a value that allows you to override automatic detection of browser capabilities and to specify how a page renders for particular browser clients.
Script |
Page.ClientTarget [ = strValue ] |
strValue |
String that specifies the browser capabilities that you want to override. |
The property is read/write with no default value.
If you do not set this property, the HttpBrowserCapabilities object associated with the Page.Request property reflects the capabilities of the client browser.
Setting this property disables client browser detection, and the page will use a fixed set of browser capabilites that you define in your application's configuration file. If you set this property, the value must correspond to a key you define in the <clientTarget> section of your application's web.config file. You must add this section to the web.config file, as it is not set by default. For more information, see ASP.NET Configuration.
For example, you could define the key ie4 to define behavior to set the ClientTarget property to that value.
<clientTarget>
<add alias="ie4" userAgent="Mozilla/4.0 ( compatible; MSIE 4.0; Windows NT 4.0 ) " />
</clientTarget>
Setting this property to ie4 will force the HttpBrowserCapabilities object associated with the page to be the equivalent of Internet Explorer 4.0 rather than the capabilites associated with the requesting client.
Page Members