Hiding blank record data

Discussion in 'ASP General' started by james.shearer@gmail.com, Nov 24, 2005.

  1. Guest

    I want to display the contents of a field with a label if there is data

    in that field. If there isn't then I don't want the label to appear.

    I tried this:

    <%If Venueinfo("email") = "" Then
    Else%>Email: <a href="mailto:<%=Venueinfo("email")%>">Click to
    email</a><br><%End If%>

    But it doesn't seem to work. It seems to always display the label and
    link even though there is no data in that field.

    help?

    this is ASP and mysql
     
    , Nov 24, 2005
    #1
    1. Advertising

  2. Evertjan. Guest

    wrote on 24 nov 2005 in microsoft.public.inetserver.asp.general:

    > <%If Venueinfo("email") = "" Then
    > Else%>Email: <a href="mailto:<%=Venueinfo("email")%>">Click to
    > email</a><br><%End If%>


    vbScript code is new-line sensitive:

    <%
    If Venueinfo("email") <> "" Then
    %>
    Email: <a href='mailto:<%=Venueinfo("email")%>'>
    Click to email</a><br>
    <%
    End If
    %>

    While jscript is not:

    <% If (Venueinfo('email')!='') { %>Email:
    <a href='mailto:<%=Venueinfo('email')%>'>
    Click to email</a><br><% }; %>


    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Nov 24, 2005
    #2
    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?SnVzdGlu?=

    Retrieving Record Key while creating the record.

    =?Utf-8?B?SnVzdGlu?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    649
    =?Utf-8?B?SnVzdGlu?=
    Oct 5, 2004
  2. Dica
    Replies:
    1
    Views:
    312
    Mark Rae [MVP]
    Aug 7, 2007
  3. David

    Additional blank record inserted ?

    David, Jan 7, 2004, in forum: ASP General
    Replies:
    4
    Views:
    115
    Ray at
    Jan 7, 2004
  4. Hiding blank record data

    , Nov 24, 2005, in forum: ASP General
    Replies:
    3
    Views:
    101
    MyndPhlyp
    Nov 25, 2005
  5. Ste
    Replies:
    41
    Views:
    835
    Thomas 'PointedEars' Lahn
    Aug 1, 2007
Loading...

Share This Page