Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2004, 10:52 AM
Authorized User
 
Join Date: Sep 2004
Posts: 68
Thanks: 1
Thanked 0 Times in 0 Posts
Default Screen Size and Java Script

Good morning.

I need to determine the user's screen size. I plan to use Java Script to do this. I then need to pass the screen size to ASP from Java Script when my web page loads.

I have no idea how to do this.

Please help.

Thank you.

Sal
 
Old December 18th, 2004, 04:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

You would have to send it back to the server side in some way, e.g. a new window, form submission in current window, change the URL of a Frame / IFrame etc.
 
Old December 18th, 2004, 06:05 PM
Authorized User
 
Join Date: Sep 2004
Posts: 68
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Is it possible to embed ASP code into Java Script? this way I can check if screen resolution is 800 X 600 and if it is, I can assign an asp variable a value stating this.

 
Old December 18th, 2004, 07:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

You could do something like :

if (screenHeight==800)
{
    document.title="this is <%=800Label%> sized";
}
if (screenHeight==1024)
{
    document.title="this is <%=1024Label%> sized";
}
 
Old December 18th, 2004, 07:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can't embed ASP code in JS as the ASP will be procedd on the server side only and the Javascript - unless it is the language that you write your ASP in - will only be processed client side.
 
Old December 20th, 2004, 07:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

I once wrote an ASP page that could collect the attributes sent from a picture. The code from the page from witch I did my detecting looks something like this;
Code:
<img src="detect.asp?Screensize=document.[js screen size
(sorry can't remember the syntax)] and so on..
In my ASP page I would collect the attributes from the QueryString and put them in a db. It's that simple!

 - mega
Moving to C# .NET





Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP script for MySQL yields white screen gnilly PHP Databases 2 November 30th, 2005 01:33 PM
Java vs Java Script functions joemorrison74 J2EE 0 July 6th, 2005 04:28 PM
Size of Screen cinest General .NET 2 October 8th, 2004 03:33 AM
changing text size on screen markhardiman Classic ASP Professional 4 August 31st, 2004 07:01 AM
Screen Size bmains VB.NET 11 June 28th, 2004 02:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.