October 2010
Intermediate to advanced
1920 pages
73h 55m
English
GridView includes two properties that enable you to display content when no results are returned from the GridView control’s data source. You can use either the EmptyDataText property or the EmptyDataTemplate property to handle empty data.
For example, the page in Listing 11.15 contains a movie search form. If you enter a search string that does not match the start of any movie title, the contents of the EmptyDataText property display (see Figure 11.10).
Figure 11.10. Displaying a message when no records match.

Listing 11.15. ShowEmptyDataText.aspx
If you use the search form in Listing 11.15 to search for a movie that ...