Search code examples
asp.netvb.netformview

FormView is completely hidden when there are no records


I have a simple FormView in a ASP.Net application. However when there are no records in the datasource, the control completely hides itself. I need to be able to have the end user add the first record view the FormView. Is there any way around this behavior?


Solution

  • You can use EmptyDataTemplate to show the formView when no data is available.

    http://msdn2.microsoft.com/us-en/system.web.ui.webcontrols.formview.emptydatatemplate(VS.80).aspx