Repeater Control Problem

Discussion in 'ASP .Net' started by Wayne Wengert, Sep 12, 2004.

  1. 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>
    Wayne Wengert, Sep 12, 2004
    #1
    1. Advertising

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

    Wayne

    "Wayne Wengert" <> wrote in message
    news:%...
    > 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>
    >
    >
    Wayne Wengert, Sep 12, 2004
    #2
    1. Advertising

  3. More information

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

    Wayne

    "Wayne Wengert" <> wrote in message
    news:%...
    > 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>
    >
    >
    Wayne Wengert, Sep 12, 2004
    #3
  4. Wayne  Wengert

    Scott Allen Guest

    Re: More information

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

    --
    Scott
    http://www.OdeToCode.com

    On Sat, 11 Sep 2004 19:31:40 -0600, "Wayne Wengert"
    <> wrote:

    >The original code works fine in Web Matrix but VSNET 2003 doesn't like it???
    >
    >Wayne
    >
    Scott Allen, Sep 12, 2004
    #4
  5. Re: More information

    Scott;

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

    Wayne

    "Scott Allen" <bitmask@[nospam].fred.net> wrote in message
    news:p...
    > I'm not sure if Web Matrix tries to validate the ASPX. The validation
    > in VS.NET is not always perfect...
    >
    > --
    > Scott
    > http://www.OdeToCode.com
    >
    > On Sat, 11 Sep 2004 19:31:40 -0600, "Wayne Wengert"
    > <> wrote:
    >
    > >The original code works fine in Web Matrix but VSNET 2003 doesn't like

    it???
    > >
    > >Wayne
    > >

    >
    Wayne Wengert, Sep 12, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    853
  2. Replies:
    0
    Views:
    2,879
  3. Replies:
    1
    Views:
    7,020
    Karl Seguin
    Aug 10, 2005
  4. uncensored
    Replies:
    0
    Views:
    815
    uncensored
    Oct 25, 2006
  5. Microsoft

    Repeater inside a Repeater

    Microsoft, Aug 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    207
    Microsoft
    Aug 21, 2006
Loading...

Share This Page