Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 18th, 2004, 10:52 AM
Authorized User
Points: 373, Level: 6
Points: 373, Level: 6 Points: 373, Level: 6 Points: 373, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2004
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old December 18th, 2004, 04:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
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.
Reply With Quote
  #3 (permalink)  
Old December 18th, 2004, 06:05 PM
Authorized User
Points: 373, Level: 6
Points: 373, Level: 6 Points: 373, Level: 6 Points: 373, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2004
Location: , , .
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.

Reply With Quote
  #4 (permalink)  
Old December 18th, 2004, 07:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
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";
}
Reply With Quote
  #5 (permalink)  
Old December 18th, 2004, 07:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
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.
Reply With Quote
  #6 (permalink)  
Old December 20th, 2004, 07:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen N, , Denmark.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:00 AM.


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