c# - Showing buttons if list view is empty -
i have list view retrieves data sql data source. trying make 2 buttons(yes , no) , label outside list view visible if list view not empty. process is: person enter information text boxes , click button retrieve, if entered data exists in database, list view shows information. have following code:
protected void btnexistingretrive_click(object sender, eventargs e) { if (lstexisting.items.count>0 ) { lblisityou.visible = true; btnyes.visible = true; btnno.visible = true; } }
by default buttons , label not visible. problem when click on retrieve button shows me list view information buttons label still not visible. became visible when double click retrieve button. please tell me mistake? thank
do bind listview before checking items count?
Comments
Post a Comment