navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

changing stylesheet for screen res

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> changing stylesheet for screen res
Page: [1]
 
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
changing stylesheet for screen res - 9/21/2004 18:34:39   
Hello Outfronters,

I've been trying to change the stylesheet used depending on the user's screen res. I made this code, it picks up the screen res no probs, and the ASP code picks up the ScreenWidth from the VBScript (I can get it to Response.Write ScreenWidth for example), it's just not including the css file. Can anyone see why?? I'm new to ASP and it's starting to do my head in!!!:)
Iain
<script language="vbscript">
	<!--
	Dim ScreenWidth
					
	ScreenWidth = window.screen.width
	-->    
</script>

<%		       
	If ScreenWidth = 800 then
  
                   <!-- #INCLUDE FILE="css800.txt"-->
                else 
    	   <!--#INCLUDE FILE="css1024.txt"-->
    	 End if	 
%>
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: changing stylesheet for screen res - 9/22/2004 1:38:40   
<SCRIPT LANGUAGE="JavaScript">
<!--
var xy = navigator.appVersion;
xz = xy.substring(0,4);
document.cookie = "ScreenWidth=" + screen.width
document.cookie = "ScreenHeight=" + screen.height
// -->
</script>

<%
strScreenWidth = Request.Cookies("ScreenWidth")
strScreenHeight = Request.Cookies("ScreenHeight")
If strScreenWidth = "" Then strScreenWidth = 800
If strScreenHeight = "" Then strScreenHeight = 600
%>
<%
Response.Write("Your screen width is: " & strScreenWidth & "<br>")
Response.Write("Your screen height is: " & strScreenHeight)
%>

However, on first vist the cookie is not retrieved till you refresh the page

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to yogaboy)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> changing stylesheet for screen res
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts