SetBrowser (obsolete)
Description
Specifies the Web browser for which you want to generate optimized
HTML.
Obsolete method
SetBrowser is obsolete and should not be used, because the Web
DataWindow technology is obsolete.
Applies to
|
DataWindow type |
Method applies to |
|---|---|
|
Web |
Server component |
Syntax
Web DataWindow server
component
|
1 |
string dwcomponent.SetBrowser ( string browsername ) |
|
Argument |
Description |
|---|---|
|
dwcomponent |
A reference to a Web DataWindow server |
|
browsername |
A string identifying the browser and version. The Sets the value of the HTMLGen.Browser For information on recognized browsers, see |
Return value
Returns an empty string if successful and the syntax error message
from the Modify method if it fails.
Usage
If the DataWindow recognizes the browser identifier, it will
generate HTML optimized for that browser. A server-side script can get the
browser identifier from the server variable HTTP_USER_AGENT.
This method calls the Modify method of the server component’s
DataStore to set the property.
Examples
This JSP example identifies the current browser for the component
called dwGen:
|
1 2 |
String browser = (String)request.getHeader ("User-Agent"); dwGen.SetBrowser(browser); |
In ASP, you can use the ServerVariables method of the Request object
to get the HTTP_USER_AGENT value:
|
1 2 |
var clientbrowser = Request.ServerVariables("HTTP_USER_AGENT"); dwGen.SetBrowser(clientbrowser); |
See also