Solved

datalist item count

Posted on 2006-07-14
4
1,207 Views
Last Modified: 2008-01-09
Hello experts,

I have a panel which displays;-

Your search query returned 0 Results.
if no result was returned. and a datalist bound to an objectdatasource

How do I determine that my datalist is empty so I can display the message like so;-

if (datalist is empty)
{
  panel1.visible = true
}
0
Comment
Question by:claracruz
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
orbulat earned 500 total points
ID: 17106534
how about?

datalist1.Items.Count == 0
0
 
LVL 10

Expert Comment

by:orbulat
ID: 17106537
you can use datalist1.Items.Count == 0 or DataSet1.Tables[0].Rows.Count == 0
0
 
LVL 7

Expert Comment

by:pradeepsudharsan
ID: 17106615
 If IsNothing(datalist1) OrElse datalist1.Items.Count = 0 Then
            Response.Write("No records found")
   End If
0
 
LVL 7

Expert Comment

by:pradeepsudharsan
ID: 17106650
In c#
      if(datalist1==null  ||  datalist1.Items.Count == 0)
                  {
                        Response.Write("No records found");
                  }
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question