asp.net.ph

DetailsView.EmptyDataText Property

System.Web.UI.WebControls Namespace   DetailsView Class


.NET Framework version 2.0

Sets or retrieves the text to display when the data source bound to a DetailsView control returns empty, or contains no data.

Syntax


Inline <asp:detailsview emptydatatext = strText ... >
Script DetailsView.EmptyDataText = strText

Property Value


strText String specifying the text displayed in the empty data row of a DetailsView control.

The property is read/write with no default value.

Remarks

Use the EmptyDataText property to specify or determine the text displayed in the empty data row of a DetailsView control. The empty data row is displayed in a DetailsView control when the data source that is bound to the control does not contain any records.

To control the style of the empty data row, use the EmptyDataRowStyle property.

Alternatively, you can define your own custom user interface ( UI ) for the empty data row by setting the EmptyDataTemplate property instead of this property.

NOTE: If both the EmptyDataText and EmptyDataTemplate properties are set, the EmptyDataTemplate property takes precedence.

Example

The following example demonstrates how to use the EmptyDataText property to specify the text to display when the data source bound to a DetailsView control returns empty, or contains no data.

<asp:detailsview id = "EmployeeDetailsView"
   datasourceid = "EmployeeSource"
   allowpaging
   datakeynames = "EmployeeID"
   emptydatatext = "No employees found."
   runat = "server">
See Also

DetailsView Members   EmptyDataTemplate   HeaderText   FooterText Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph