Click to See Complete Forum and Search --> : Passing Javascript variables to ASP? Reading cookies from ASP?
Jimmy
03-20-2001, 06:21 PM
2 questions:
is it possible to pass javascript variable data to ASP? for instance, if
i had both javascript andASP working on the same page, could I somehow use
a previously created javascript variable inside of the ASP code?
second question:
is there a way for me to read the contents of a cookie in ASP code? I can
do this in javascript but i'm not sure how to do it in ASP. thanks.
~jimmy.
Matt Vaughn
03-20-2001, 06:47 PM
You are probably trying to use the .js variable to maintain some kind of
state within your application. I would put the variable in a hidden form
field or append to the querystring if you can. This way it will be available
to ASP when it goes to the new page. I hope this helps.
"Jimmy" <unreal@angband.org> wrote in message
news:3ab7e602$1@news.devx.com...
>
> 2 questions:
>
> is it possible to pass javascript variable data to ASP? for instance, if
> i had both javascript andASP working on the same page, could I somehow use
> a previously created javascript variable inside of the ASP code?
>
> second question:
>
> is there a way for me to read the contents of a cookie in ASP code? I can
> do this in javascript but i'm not sure how to do it in ASP. thanks.
>
> ~jimmy.
T. Bradley Dean
03-20-2001, 07:10 PM
> second question:
>
> is there a way for me to read the contents of a cookie in ASP code?
To read a cookie:
String = Request.Cookie("CookieName")
To write a cookie:
Response.Cookie("CookieName") = String
There are a few really good articles on ASP and Cookies as
4GuysFromRolla.com.
--
Bradley Dean
"Jimmy" <unreal@angband.org> wrote in message
news:3ab7e602$1@news.devx.com...
>
> 2 questions:
>
> is it possible to pass javascript variable data to ASP? for instance, if
> i had both javascript andASP working on the same page, could I somehow use
> a previously created javascript variable inside of the ASP code?
>
> second question:
>
> is there a way for me to read the contents of a cookie in ASP code? I can
> do this in javascript but i'm not sure how to do it in ASP. thanks.
>
> ~jimmy.
devx.com
Copyright Internet.com Inc. All Rights Reserved