Name
ClientTarget
Synopsis
String = Page.ClientTarget
Gets
or sets a string value that allows you to
override automatic browser detection in ASP.NET, force the page to be
rendered for a browser type configured in
machine.config or
web.config, and specified by this property. The
available preconfigured values for this property are:
-
downlevel The page will be rendered based on the browser capabilities defined for unknown browsers in the
<browserCaps>element ofmachine.config.-
ie4 The page will be rendered based on the values for Internet Explorer 4.0 configured in the
<browserCaps>element ofmachine.config.-
ie5 The page will be rendered based on the values for Internet Explorer 5.0 configured in the
<browserCaps>element ofmachine.config.
Parameters
-
String A string that specifies the alias for the browser capabilities that the page will target.
Example
The following code example initializes the ClientTarget property of
the Page class to downlevel,
indicating that ASP.NET must render the page for an unknown browser
type, which will result in HTML 3.2-compliant output. The example
then displays a message indicating whether a set of features is
supported. In the case of downlevel, none of the
listed features is supported.
Sub Page_Load( ) Page.ClientTarget = "downlevel" Message.Text = "Page is set to render for the " & _ Page.ClientTarget & " alias.<br/>" Message.Text &= "Supported features:<br/>" Message.Text &= " - JavaScript: " & _ Request.Browser.JavaScript & "<br/>" Message.Text ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access