FormView::EmptyDataTemplate Property
Gets or sets the user-defined content for the empty data row rendered when a FormView control is bound to a data source that does not contain any records.
Assembly: System.Web (in System.Web.dll)
[BrowsableAttribute(false)] [PersistenceModeAttribute(PersistenceMode::InnerProperty)] [TemplateContainerAttribute(typeof(FormView))] public: virtual property ITemplate^ EmptyDataTemplate { ITemplate^ get (); void set (ITemplate^ value); }
<asp:FormView> <EmptyDataTemplate>ITemplate</EmptyDataTemplate> </asp:FormView>
Property Value
Type: System.Web.UI::ITemplateA System.Web.UI::ITemplate that contains the custom content for the empty data row. The default value is nullptr, which indicates that this property is not set.
The empty data row is displayed in a FormView control when the data source that is bound to the control does not contain any records. You can define your own custom user interface (UI) for the empty data row by using the EmptyDataTemplate property. To specify a custom template for the empty data row, first place <EmptyDataTemplate> tags between the opening and closing tags of the FormView control. You can then list the contents of the template between the opening and closing <EmptyDataTemplate> tags. To control the style of the empty data row, use the EmptyDataRowStyle property. Alternatively, you can use the built-in UI for the empty data row by setting the EmptyDataText property instead of this property.
Note: |
|---|
If both the EmptyDataText and EmptyDataTemplate properties are set, the EmptyDataTemplate property takes precedence. |
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: