Results 1 to 2 of 2

Thread: Detecting Screen Resolution

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Location
    London, England
    Posts
    213
    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 ?


  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    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

    Code:
    <HTML>
    
    <body>
    
    <script language=javascript>
    
    location.replace("page2.asp?txtWidth=" + screen.width + "&txtHeight=" + screen.height );
    </script>
    
    </body>
    </HTML>
    page2.asp

    Code:
    <%@ 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]
    Mark
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width