Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Best way to get screen resolution
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

sr_erick
Senior Member

USA
1318 Posts

Posted - 22 October 2003 :  00:20:32  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
What is the best way to get a users screen resolution so I can assign some values to some variables depending on what resolution they have?

I have thought about using javascript. Is there an "all asp" way of doing it?




Erick
Snowmobile Fanatics

dayve
Forum Moderator

USA
5820 Posts

Posted - 22 October 2003 :  00:23:53  Show Profile  Visit dayve's Homepage
Can't do it with ASP because it is a client side property you need to read.

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 22 October 2003 :  00:39:38  Show Profile  Visit dayve's Homepage
a way of doing this can be accomplished by using a javascript detection script. writing the value to a hidden form object and submitting that to a database.

Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 22 October 2003 :  00:56:54  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
I need to be able to find this out as the page loads so I can assign things right away. The reason is because I am trying to set up ASPimage so it will resize a picture according to the screen resolution of the user.




Erick
Snowmobile Fanatics

Go to Top of Page

The Impact
Junior Member

Australia
398 Posts

Posted - 22 October 2003 :  04:15:08  Show Profile
You can find the user's resolution with client side code like this but it'll only work in IE.
<script language="VBScript">
Document.Write    "Your resolution is " & Screen.Width & " x " & Screen.Height
</script>
Probably better to use Javascript as this will provide cross browser support.
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 22 October 2003 :  04:38:31  Show Profile  Visit D3mon's Homepage
Don't get the display resolution (it won't relate if the user is running the browser in a smaller window.) Get the 'usable area' instead which should give you the actual size of the browser window.


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

Edited by - D3mon on 22 October 2003 04:38:57
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 22 October 2003 :  04:45:44  Show Profile
quote:
Originally posted by sr_erick

The reason is because I am trying to set up ASPimage so it will resize a picture according to the screen resolution of the user.



Have a look at this
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=47947&whichpage=1

The UK MkIVs Forum
Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 22 October 2003 :  10:15:27  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
Yeah that just changes the width and height though, I am having the server actually resize the image. I only want to find the persons screen resolution so that the pictures will fit when they have the window maximized. If I get too many different sizes I am afraid that the server load will be too great.




Erick
Snowmobile Fanatics

Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 22 October 2003 :  13:58:56  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
There is the Browser Hawk component that gives you all the users info

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 22 October 2003 :  19:39:55  Show Profile  Visit dayve's Homepage
quote:
Originally posted by redbrad0

There is the Browser Hawk component that gives you all the users info



he still needs to get this information on the server side though.

Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 22 October 2003 :  21:04:37  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I thought Browser Hawk would send the information to the server

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 22 October 2003 :  22:04:41  Show Profile  Visit dayve's Homepage
oooops, you're right... but there is some definite latency when I tested it.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07