Working with Sessions for functions

I have a problem.
I'm having on my site a Session by the name "UserLogon"
which will either have values "true" or "false".
I want to use that information with a function so I will be able to make an
image be visible or not.
However i don't think that it is possible to have asp codes inside <script>.
what should i do?
Chen Leikehmacher [ Di, 19 Juni 2007 02:05 ] [ ID #1742001 ]

Re: Working with Sessions for functions

Chen Leikehmacher wrote:
> I have a problem.
> I'm having on my site a Session by the name "UserLogon"
> which will either have values "true" or "false".
> I want to use that information with a function so I will be able to
> make an image be visible or not.
> However i don't think that it is possible to have asp codes inside
> <script>. what should i do?
<%
dim display
if cbool(session("UserLogon")) then
display="inline"
else
display="none"
end if
%>
....
<img style="display:<%=display%>" ...

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
reb01501 [ Di, 19 Juni 2007 01:14 ] [ ID #1742002 ]

Re: Working with Sessions for functions

Gazing into my crystal ball I observed "Chen Leikehmacher"
<chen.leikehmacher [at] gmail.com> writing in
news:u8Shh0fsHHA.4364 [at] TK2MSFTNGP06.phx.gbl:

> I have a problem.
> I'm having on my site a Session by the name "UserLogon"
> which will either have values "true" or "false".
> I want to use that information with a function so I will be able to
> make an image be visible or not.
> However i don't think that it is possible to have asp codes inside
> <script>. what should i do?
>
>
>

<% dim mymessage
mymessage = "Hello world"
%>
<script type="text/javascript">
alert("<%=mymessage%>";)
</script>


--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Adrienne Boswell [ Mi, 20 Juni 2007 06:39 ] [ ID #1744003 ]
Webserver » microsoft.public.inetserver.asp.db » Working with Sessions for functions

Vorheriges Thema: Error with SQL
Nächstes Thema: Need help building query