Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / June 2007



Tip: Looking for answers? Try searching our database.

Working with Sessions for functions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chen Leikehmacher - 19 Jun 2007 00:16 GMT
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?
Bob Barrows [MVP] - 19 Jun 2007 00:14 GMT
> I have a problem.
> I'm having on my site a Session by the name "UserLogon"
[quoted text clipped - 3 lines]
> 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%>" ...

Signature

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"

Adrienne Boswell - 20 Jun 2007 05:39 GMT
> I have a problem.
> I'm having on my site a Session by the name "UserLogon"
[quoted text clipped - 3 lines]
> 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>

Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.