Print Page | Close Window

Changing layout dynamically to fit screen

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=13163
Printed Date: 30 March 2026 at 11:05pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Changing layout dynamically to fit screen
Posted By: Agni
Subject: Changing layout dynamically to fit screen
Date Posted: 31 December 2004 at 4:23am
My main site page www.agni.gr fits fine on my screen (17''), but on my old work PC (15"") it does not fix. Of course I use tables for the layout (at 100%), but I would like to find the client screen resolution (I'm sure there is a server variable that I can access with asp) and if so, I could change the layout accordingly to fit.

Aynone had any success doing this?

Thanks

Nathan



-------------
www.agni.gr
Travel To Greece Guide



Replies:
Posted By: dpyers
Date Posted: 31 December 2004 at 9:38am
The only way to do it in asp is
response.write(request.servervariables("http_ua_pixels"))
But it's only supported in one browser that I know of.
 
Another alternative is to use javascript in an entry page and redirect to aother page or set some session variables/cookies based upon screen resolution
document.write("screen width=" + screen.width + "<br>");
document.write("screen height=" + screen.height + "<br>");
document.write("available screen width=" + screen.availwidth + "<br>");
document.write("available screen height=" + screen.availheight + "<br>");
That won't work if they have javascript disabled.
 
Screen resolution as a key to site design is bogus to begin with. What makes you think I use my browser full screen? You need to be concerned with the size of the browser's viewport, not the size of the screen it's displayed on.
 
You're much better off to go with a fluid solution and allow the user to view your site with using their preferences - not yours. You also don't have to maintain different sites for different screen resolutions.
 
EDIT: Went to your site using fire fox set to different sizes - 800x600, 1024x768, and 1600x1200. Looks good in all sizes although there's some horizontal scrolling needed in 800x600. Expands well to full screen 1600x1200.


-------------

Lead me not into temptation... I know the short cut, follow me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net