Can't seem to bind data in a header or footer of a datalist.

U

UJ

I'm trying to bind data in a header list and it doesn't appear to work. My
code is:


<asp:DataList id="dgOurSolutionArray" runat="server"
RepeatDirection="Horizontal" RepeatColumns="4">
<HeaderTemplate>Fred
<%# DataBinder.Eval(Container.DataItem, "ShortDescription") %>
</HeaderTemplate>
<FooterTemplate>
<%# DataBinder.Eval(Container.DataItem, "SolutionID") %>
</FooterTemplate>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "ShortDescription") %>
</ItemTemplate>
</asp:DataList>


I get my short description once, and Fred at the top. No matter what I put
in for the header/footer for DataElements, it doesn't seem to show up.

Any ideas?

TIA - Jeff.
 
K

Ken Cox [Microsoft MVP]

The HeaderTemplate and FooterTemplate aren't designed for repeating data the
way ItemTemplate is.

What is it that you're trying to accomplish?

Ken
Microsoft MVP [ASP.NET]
 

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

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top