Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reading Session Variables from Client Side Script (functions)

50 views
Skip to first unread message

Allen

unread,
Sep 19, 2000, 3:00:00 AM9/19/00
to
I am writing a web page that has a layer that I wish to be able to
show or hide dynamically based on a session variable
<%=Session("xyz")%>. The trigger will be the onFocus event in the
body tag. When I call my custom JS or VBS function that has my
session variable (lets say MsgBox (<%=Session("xyz")%>)) I either get
an error that basically says my variable is not valid or I get a blank
value.

So much for a quick and easy way to keep from refreshing my page.

Code Sample:
<html>
<head>
<title>Test Page</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

<script language="VBScript">

function CAC_checkValue()
MsgBox(<%=Session("xyz")%>)
end function

</script>

</head>

<body bgcolor="#fef8e9" onLoad="" onFocus="CAC_checkValue()">


TIA,
Allen

Send replies to "hossnine....@hotmail.com"
Remove ".nolikespam"


OHMEGASTAR

unread,
Sep 19, 2000, 3:00:00 AM9/19/00
to

My Experience with Session (and any other global.asa variables are that you
have to physically restarrt the web server in order to load new variables.
(I use PWS and W98)..
Also you have to give the Session Variable a "default" value within your
golbal.asa

hth

Henrik Ohm

"Allen" <a...@nowhere.com> wrote in message
news:ktkfsscdcjip2toe8...@4ax.com...

Phillip Manske

unread,
Sep 19, 2000, 3:00:00 AM9/19/00
to
Thats a tough one but I saw an article about remote scripting from element K
jounals

Cliff Estes

unread,
Sep 20, 2000, 3:00:00 AM9/20/00
to
I may not be understanding your message, but session variables is that they
are maintained by the server. The client knows nothing of their existence,
while the server knows nothing of the onfocus event.

To confirm this, look at the code in the browser. Nowhere will you see any
reference to any session vars. Nor will you see any <% %> pairs.

Allen wrote in message ...

mmm

unread,
Sep 20, 2000, 3:00:00 AM9/20/00
to

Sounds little funny.. but try this...

MsgBox( "<%=Session('xyz')%>")

i.e. putting MsgBox parameter in double quotes and argument to Session()
in single quotes...

Mehul


Allen <a...@nowhere.com> wrote in message
news:ktkfsscdcjip2toe8...@4ax.com...

> I am writing a web page that has a layer that I wish to be able to
> show or hide dynamically based on a session variable
> <%=Session("xyz")%>. The trigger will be the onFocus event in the
> body tag. When I call my custom JS or VBS function that has my
> session variable (lets say MsgBox (<%=Session("xyz")%>)) I either get
> an error that basically says my variable is not valid or I get a blank
> value.
>

0 new messages