Repeater/No Data message -- How?

Discussion in 'ASP .Net' started by Chad A. Beckner, Jun 16, 2004.

  1. Hey all,

    I have a repeater setup which pulls data from a SQL server. If there is
    no data, I want to display a message "No Data". How can I do this?

    Thanks in advance!

    Chad
     
    Chad A. Beckner, Jun 16, 2004
    #1
    1. Advertisements

  2. Chad A. Beckner

    Cliff Harris Guest

    I usually just have a label right above my repeater that I default to not
    visible. Then, when I fill up the datatable that I am going to bind to the
    repeater. I check the row count. If it's 0, I hide the repeater and show
    the label that says there is no data.

    HTH,
    -Cliff
     
    Cliff Harris, Jun 16, 2004
    #2
    1. Advertisements

  3. I figured as much, that's what I just got done doing. So, you "can" or "can
    not" add the label dynamically (at runtime) and then hide the repeater (in
    essence, replacing it?)

    Chad
     
    Chad A. Beckner, Jun 16, 2004
    #3
  4. Chad A. Beckner

    Cliff Harris Guest

    I guess you could add the label dynamically... it's just a lot easier if I
    don't have to worry about adding it to the page in the right place, etc. So
    I just hide it. Hack? I don't think so, but, hey, that's me.

    -Cliff
     
    Cliff Harris, Jun 17, 2004
    #4
  5. Chad A. Beckner

    zkamal

    Joined:
    Aug 10, 2011
    Messages:
    1
    Likes Received:
    0
    zkamal, Aug 10, 2011
    #5
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.