BeanSoftware Logo

ASP.NET Database Search Control

    Write For Us

Why DataList Control Is Not Visible On Page?

When you drag DataList control from the toolbox to web form, gray rectangle is displayed, like in image bellow:

DataList Control on the web form

If you try to run the page, nothing will be displayed. This happen because DataList control requires tag.

ItemTemplate defines how DataList control will look at run time. You can mix HTML and ASP.NET markup do design appropriate look. This simple example shows customers names listed in DataList control:

<asp:DataList id="dlCustomers" runat="server">
  <b>Customer name:</b> <%#DataBinder.Eval(Container.DataItem, "FirstName")%>
  <%#DataBinder.Eval(Container.DataItem, "LastName")%>

Related articles:

1. Data Source Controls in ASP.NET 2.0

FAQ toolbar: Submit FAQ  |  Tell A Friend  |  Add to favorites  |  Feedback

Copyright © 2002-2008 Bean Software. All rights reserved.