W3C home > Mailing lists > Public > www-validator-css@w3.org > January 2007

RE: CSS errors when setting values with asp session variables

From: Douglas Perreault <doug@perreault.us>
Date: Tue, 16 Jan 2007 09:01:12 -0500
To: "'Roger Withnell'" <roger@upperbridge.co.uk>
Cc: <www-validator-css@w3.org>
Message-ID: <01d901c73976$c87fc790$6400a8c0@perreault.us>
The answer is probably in the value of the session variables. I suspect when
the validator checks the page, the session variable is empty, but when you
check it, there is a value there. How is a value getting entered into the
session variable "RGB"? I don't know if the validator has cookies available
to it (and session variables are really just a form of cookies, albeit
temporary ones).
Change your code to this and see what happens:
If IsEmpty(Session("RGB")) or IsNull(Session("RGB"))  _
    or Session("RGB")="" then RGBValue="FFFFCC" else RGBValue=Session("RGB")
Response.write "body{background:" & RGBValue & "}"


From: Roger Withnell [mailto:roger@upperbridge.co.uk] 
Sent: Tuesday, January 16, 2007 6:33 AM
To: 'Douglas Perreault'
Subject: RE: CSS errors when setting values with asp session variables

Dear Doug


Thanks for your email. 


I am entering the url into the CSS validator.  As you say, the ASP
interpreter interprets the code into HTML which is returned to the
validator.  However:


If, within the style tags, I set body{background: #FFFFCC}, the validator
runs without errors.


But if, within the style tags, I set body{background: <%= Session("RGB") %>}
(actually my code is Response.Write "body{background:" & Session("RGB") &
"}") the validator gives the following error:  body:  Invalid number
background parse error.


If I view the pages source code in the browser, this CSS property looks
exactly the same either way.


I much appreciated your help.




Received on Tuesday, 16 January 2007 14:01:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:40:43 UTC