Repeater Control Problem

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>
 
W

Wayne Wengert

Think I found the problem - the <table> tag has to be outside the <repeater>
tag. Looks like the on-line help is wrong?

Wayne
 
W

Wayne Wengert

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

Wayne
 
S

Scott Allen

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

Wayne Wengert

Scott;

Good point. The Web Matrix code does appear to run fine however.

Wayne
 

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,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top