1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Remove empty fields

Discussion in 'C#' started by Francis_htli, Dec 3, 2007.

  1. #1
    <FIELDSET><legend>Deadlines - Dates</legend>
    Conference Sponsorship: <font color="#777777"><%=replace(rec("cdate"), "1/1/1900", "")%></font>&nbsp;&nbsp;&nbsp; Speaker Proposals: <font color="#777777"><%=replace(rec("sdate"), "1/1/1900", "")%></font>&nbsp;&nbsp;&nbsp;Conference Registration: <font color="#777777"><%=replace(rec("rdate"), "1/1/1900", "")%></font><br><br>
    Hotel Registration: <font color="#777777"><%=replace(rec("hdate"), "1/1/1900", "")%></font>&nbsp;&nbsp;&nbsp;Conference Early Bird Registration: <font color="#777777"><%=replace(rec("edate"), "1/1/1900", "")%></font>

    This is the page that has a section to display dates enter by users from another input form. Input fields are optional. If there is no information for any specific fields, then it wouldn't be displayed. How do I write the code that doesn't display empty fields?
    Francis_htli, Dec 3, 2007 IP
  2. DPGBB

    DPGBB Peon

    Likes Received:
    Best Answers:
    Trophy Points:
    Assign your recordset to variables and then check if it's not an empty string

    If myvariable<>"" Then
    Response.write myvariable
    End If
    DPGBB, Dec 3, 2007 IP