Click to See Complete Forum and Search --> : Detecting Screen Resolution
nmretd
Oct 9th, 2000, 03:28 AM
I want to use ASP to detect my web surfer's screen resolution and then redirect them to the relevant page. How can I do this. Can someone show me the code please ?
Mark Sreeves
Oct 9th, 2000, 05:12 AM
What you want to do can be achived with Client-side Javascript and you don't need ASP at all.
but that's not answering your question!
page1.htm
<HTML>
<body>
<script language=javascript>
location.replace("page2.asp?txtWidth=" + screen.width + "&txtHeight=" + screen.height );
</script>
</body>
</HTML>
page2.asp
<%@ Language=VBScript %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
dim theWidth
dim theHeight
theWidth = request("txtWidth")
theHeight = request("txtHeight")
'put your redirection code here
response.write("Client width: " & theWidth & "<BR>")
response.write("Client height: " & theHeight & "<BR>")
%>
</BODY>
</HTML>
[Edited by Mark Sreeves on 10-09-2000 at 06:20 AM]
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.