DataList not being rendered

G

Guest

Thanks in advance to anyone who can help :)

I'm fairly new to templated asp.net controls- my dataList is not appearing-
its very simple and all of the code is being placed inline via tags.
Here's the code:

<asp:DataList ID="dtList" runat="server"><HeaderTemplate><table><tr
style="background-color:#0000cc;color:#FFFFFF"><th>Name</th><th>Phone
Number</th><th>Title</th></tr></HeaderTemplate>
<ItemTemplate><tr><td>Joe
Blow</td><td>555-934-0234</td><td>"Tester"</td>
</tr></ItemTemplate>
<FooterTemplate></table></FooterTemplate>
</asp:DataList>

There's basic caveats that I haven't found in my online searches regarding
datalists' that's causing it not to be rendered, I guess.
-The <ItemTemplate> tag is required, yet does the datalist have to bind to a
datasource for it to be rendered?
 
E

Eliyahu Goldin

DataList is supposed to get populated with data from a data source. You
neither have one nor specify any databounding in your item template.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top