Repeater/No Data message -- How?

C

Chad A. Beckner

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
 
C

Cliff Harris

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
 
C

Chad A. Beckner

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
 
C

Cliff Harris

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
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top