October 2010
Intermediate to advanced
1920 pages
73h 55m
English
DetailsView ControlThe DetailsView control includes two properties that you can use to display a message when no results are returned from its data source. You can use the EmptyDataText property to display an HTML string, or the EmptyDataTemplate property to display more complicated content.
For example, SqlDataSource in Listing 12.4 does not return a record because no record in the Movies database table has an ID of -1.
Listing 12.4. ShowEmptyDataText.aspx

When you open the page in Listing 12.4, the contents of the EmptyDataText property display.
If you need to display more complicated content when no results ...