asp.net.ph

Page.ClientTarget Property

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.

Syntax


Script Page.ClientTarget [ = strValue ]

Property Value


strValue String that specifies the browser capabilities that you want to override.

The property is read/write with no default value.

Remarks

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.

See Also

Page Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph