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

Discussion in 'ASP General' started by mallyonline, Oct 7, 2005.

  1. mallyonline

    mallyonline Guest

    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
     
    mallyonline, Oct 7, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:di6nv8$eec$-infra.bt.com...
    >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
    >
    >
     
    Ray Costanzo [MVP], Oct 7, 2005
    #2
    1. Advertising

  3. mallyonline

    McKirahan Guest

    "mallyonline" <> wrote in message
    news:di6nv8$eec$-infra.bt.com...
    > 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
     
    McKirahan, Oct 7, 2005
    #3
  4. mallyonline

    mallyonline Guest

    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 [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > 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" <> wrote in message
    > news:di6nv8$eec$-infra.bt.com...
    >>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
    >>
    >>

    >
    >
     
    mallyonline, Oct 9, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWlrZQ==?=

    greater then / less then

    =?Utf-8?B?TWlrZQ==?=, Nov 4, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,627
    Kevin Spencer
    Nov 4, 2004
  2. JosephByrns

    Slow, then quick then slow

    JosephByrns, Jul 10, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    2,517
    codezilla94
    Nov 13, 2007
  3. Tor Erik Soenvisen
    Replies:
    14
    Views:
    591
    Tim Roberts
    Nov 23, 2006
  4. maestro
    Replies:
    1
    Views:
    324
    Chris
    Aug 11, 2008
  5. Replies:
    0
    Views:
    336
Loading...

Share This Page