BeanSoftware Logo
 

 
ASP.NET Database Search Control
 
 

 
 Home
    Shop
    Advertise
    Write For Us
    Affiliate
    Newsletter
    Contact

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">
<ItemTemplate>
  <b>Customer name:</b> <%#DataBinder.Eval(Container.DataItem, "FirstName")%>
  <%#DataBinder.Eval(Container.DataItem, "LastName")%>
</ItemTemplate>
</asp:DataList>



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.