Search code examples
asp.netcontrolsdatalist

ASP.NET DataList for a single item


Context: In an ASP.NET application, I need the behavior of the ItemTemplate / EditItemTemplate that the DataList control provides. However, I only need one item in my control, which makes the DataList seems like overkill.

Question: Is there a control in ASP.NET made to store a single item that has the template content behavior of the DataList and DataGrid? Should I use a DataList for only one item?


Solution

  • Why don't you use the FormView or DetailsView? They are meant to display one item (at the time).