If Len(Session("UID")) = 0 Then

M

mallyonline

I last posted to this group about 6 months ago and was very pleased by the
excellent response I got and the great help offered to me. I am back this
time with another request for your expert help on a bit of ASP code I use on
my windows server 2003 with IIS6 machine.

I would like the code below to display in different colours depending on the
status of the page. I am looking to make the not logged in code appear red
and the logged in code green.

The code:
<%
If Len(Session("UID")) = 0 Then
Response.Write "<b>You are not logged on. If You don't have a username
or password you can register for one by clicking > </b>"
Else
Response.Write "<b>You are logged on as " & Session("UID") & "</b>"
End If
%>

If anyone can help this would be great.

Thank you

malcolm
 
R

Ray Costanzo [MVP]

So, the question is about what, how to make font colored? That's
interesting. Most people know such things before they learn programming.
:]

How about:

<style type="text/css">
span.loggedin { color: #00ff00; }
span.loggedout { color: #ff0000; }
</style>

<%
If Len(Session("UID")) = 0 Then
Response.Write "<span class=""loggedout""><b>You are not logged on. If
You don't have a username or password you can register for one by
clicking</b></span>"
Else
Response.Write "<span class=""loggedin""><b>You are logged on as " &
Session("UID") & "</b></span>"
End If
%>

Ray at work
 
M

McKirahan

mallyonline said:
I last posted to this group about 6 months ago and was very pleased by the
excellent response I got and the great help offered to me. I am back this
time with another request for your expert help on a bit of ASP code I use on
my windows server 2003 with IIS6 machine.

I would like the code below to display in different colours depending on the
status of the page. I am looking to make the not logged in code appear red
and the logged in code green.

The code:
<%
If Len(Session("UID")) = 0 Then
Response.Write "<b>You are not logged on. If You don't have a username
or password you can register for one by clicking > </b>"
Else
Response.Write "<b>You are logged on as " & Session("UID") & "</b>"
End If
%>

If anyone can help this would be great.

Thank you

malcolm

http://www.aspfaq.com/5003
 
M

mallyonline

This to me was a little bit more complicated since i use WYSIWYG and trying
to put together asp code found from other sources.
When things dont work i am lost? :(


Ray Costanzo said:
So, the question is about what, how to make font colored? That's
interesting. Most people know such things before they learn programming.
:]

How about:

<style type="text/css">
span.loggedin { color: #00ff00; }
span.loggedout { color: #ff0000; }
</style>

<%
If Len(Session("UID")) = 0 Then
Response.Write "<span class=""loggedout""><b>You are not logged on. If
You don't have a username or password you can register for one by
clicking</b></span>"
Else
Response.Write "<span class=""loggedin""><b>You are logged on as " &
Session("UID") & "</b></span>"
End If
%>

Ray at work



mallyonline said:
I last posted to this group about 6 months ago and was very pleased by the
excellent response I got and the great help offered to me. I am back this
time with another request for your expert help on a bit of ASP code I use
on
my windows server 2003 with IIS6 machine.

I would like the code below to display in different colours depending on
the
status of the page. I am looking to make the not logged in code appear
red
and the logged in code green.

The code:
<%
If Len(Session("UID")) = 0 Then
Response.Write "<b>You are not logged on. If You don't have a username
or password you can register for one by clicking > </b>"
Else
Response.Write "<b>You are logged on as " & Session("UID") & "</b>"
End If
%>

If anyone can help this would be great.

Thank you

malcolm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top