Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen Resolution 1

Status
Not open for further replies.

Miked811

Programmer
Apr 17, 2005
61
CA
hi,

how can i get the screen resolution using vbscript and applying it on ASP?

thanks
 
i tried using screen.width and i get an error message saying:

Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'screen'

thanks
 
screen.width is a client-side script, unfortunately asp can't tell you the screen resolution

The new version of the Browser Capabilities component that comes with ASP 3.0 in Windows 2000 has a neat feature that allows us to collect information about each specific user's browser, rather than just relying on the values that are generic to each browser. Obviously, the browscap.ini file that the Browser Capabilities component uses to identify the browser from its USER-AGENT string can only contain general information that applies to that browser. In other words, [red]it can tell you if it supports frames or ActiveX controls, but it can't tell you what screen resolution (for example) the user is running in[/red].

from
 
mike,

are you simply trying to let the server do this because of not wanting to have a use w/ scripts off? or you just tring to get the script to work? if that's the case then use this js script to do it...asp and js and html can easily combine w/ each other

Code:
<html>
<head>
</head>
<body>
<p><%=Date%></p>


<SCRIPT LANGUAGE= "JavaScript">
<!--
  document.write("screen height is " + screen.height + " pixels.<br>");
  document.write("screen width is " + screen.width + " pixels.<br>");
//-->
</SCRIPT>

<p><%=Time%></p>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top