Print Page | Close Window

screen resolution

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
Printed Date: 29 November 2023 at 4:49am
Software Version: Web Wiz Forums 12.06 -

Topic: screen resolution
Posted By: Roberto Randall
Subject: screen resolution
Date Posted: 08 May 2013 at 8:34pm
I wish to know how I can detect the users screen resolution. I want to display an ad on the side of the forum if the resolution is higher than 1024.


Dim strScreen
Dim strShow

strScreen = "user screen resolution"
If strScreen => "1024" Then strShow = True

Thank you,

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

Posted By: WebWiz-Bruce
Date Posted: 09 May 2013 at 9:30am
You would need to use JavaScript to detect the screen resolution of the visitor:-" rel="nofollow -

-------------" rel="nofollow - Web Wiz Forums Hosting" rel="nofollow - ASP.NET Web Hosting

Posted By: wistex
Date Posted: 08 September 2013 at 1:33am
Is there a way to pass that information directly to ASP?  The only way I figured out how to do that is have the Javascript set a cookie, and then on the next page load read the cookie to get the resolution.

-------------" rel="nofollow - WisTex Solutions" rel="nofollow - CaribbeanChoice Forums

Posted By: xentia
Date Posted: 15 September 2013 at 9:56pm
You can pass JavaScript results to ASP server side page with some simple form like:

<form target="set_resolution.asp" method="post" id="frm_scr" name="frm_scr">
<input type="hidden" id="scr_width" value="">
<input type="hidden" id="scr_height" value="">

be note that document.body.clientHeight/Width is available in IE 8+. There is other way to get screen dimensions with JavaScript, but the idea to pass that data to ASP is same. Hope that this help

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.06 -
Copyright ©2001-2023 Web Wiz Ltd. -