Variables (Full Version)

All Forums >> [Web Development] >> Microsoft FrontPage Help



Message


Matth -> Variables (4/11/2001 20:46:00)

Hi

I'm trying to let the user choose his own background color. I've placed a little .gif with hotspots on one page. From there I link to a 'mood.asp' page, where I'd like to pass on different variables. So, for color 1, I'd use the link: mood.asp?mood=1

In the mood.asp I've got the following code, but for some reason this just does not work.

<% dim vbgcolor
Select case ::mood::
case 1
vbgcolor = "#F4D9FF"
case 2
vbgcolor = "#F2F9FF"
End Select

response.Cookies("mood")("bgcolor") = vbgcolor
response.Cookies("mood").Expires = DateAdd("m",1,Date)
%>

First I tried the same thing without the case, and it worked using the cookie. But there must be something wrong with the case statement...

Any help highly appreciated!

Matthias





Matth -> RE: Variables (4/11/2001 20:05:00)

Found it myself

That's what is needed:
<body bgcolor=<%=request.Cookies("mood")("bgcolor")%>>

<%
Select case request("mood")
case "blue"
vbgcolor = "#F4F9FF"
case "purple"
vbgcolor = "#F2A9FF"
case "beige"
vbgcolor = "#F2G9FF"
case else
vbgcolor = "#F2C9FF"
End Select

response.Cookies("mood")("bgcolor") = vbgcolor
response.Cookies("mood").Expires = DateAdd("m",1,Date)
%>






Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.03125