Repeater Control Problem

  • Thread starter Thread starter Wayne Wengert
  • Start date Start date
W

Wayne Wengert

I am trying to use a repeater control on a .NEW Web Form. I modelled my code
after the example in the on-line help (see code below) but VSNET complains
that: "Within a server element, the element 'table' is missing its closing
tag or overlaps with element 'HeaderTemplate'."

What is the correct way to accomplish this?



=============== Code ===============
<asp:Repeater id="Repeater1" runat="server">
<HeaderTemplate>
<table width="100%" style="font: 8pt verdana">
<tr style="background-color:DFA894">
<th>
WGI Event
</th>
<th>
Start Date
</th>
<th>
Units<br />Registered
</th>
<th>Closed?</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container, "DataItem.RegionalID") %>
</td>
<td><%# DataBinder.Eval(Container,"DataItem.StartDate") %>
</td>
<td><%# DataBinder.Eval(Container,"DataItem.UnitCount") %>
</td>
<td><%# DataBinder.Eval(Container,"DataItem.CGClosed") %>
</td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr>
<td bgcolor="lightblue">
<%# DataBinder.Eval(Container, "DataItem.RegionalID") %>
</td>
<td bgcolor="lightblue">
<%# DataBinder.Eval(Container,"DataItem.StartDate") %>
</td>
<td bgcolor="lightblue">
<%# DataBinder.Eval(Container,"DataItem.UnitCount") %>
</td>
<td bgcolor="lightblue">
<%# DataBinder.Eval(Container,"DataItem.CGClosed") %>
</td>
</tr>
</AlternatingItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
 
Think I found the problem - the <table> tag has to be outside the <repeater>
tag. Looks like the on-line help is wrong?

Wayne
 
The original code works fine in Web Matrix but VSNET 2003 doesn't like it???

Wayne
 
I'm not sure if Web Matrix tries to validate the ASPX. The validation
in VS.NET is not always perfect...
 
Back
Top