Repeater rendering troubles

Last post 03-12-2009 1:37 PM by dru987. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-12-2009 1:21 PM

    • dru987
    • Top 500 Contributor
    • Joined on 03-12-2009
    • Wannabe Slacker
    • Points 13

    Repeater rendering troubles

    i have a repeater control that i am trying to use for rendering rows for a table.

    <ajaxdata:repeater id="agentRepeater" runat="server" itemdataboundevent="onItemDataBound">
        <headertemplate>
            <table class="datatable">
                <thead>
                    <tr>
                        <th>Id</th>
                        <th>First Name</th>
                        <th>Last Name</th>
                    </tr>
                </thead>
                <tbody>
        </headertemplate>
        <itemtemplate>
                    <tr>
                        <td><span id="idSpan"></span></td>
                        <td><span id="firstNameSpan"></span></td>
                        <td><span id="lastNameSpan"></span></td>
                    </tr>
        </itemtemplate>
        <footertemplate>
                </tbody>
            </table>
        </footertemplate>
    </ajaxdata:repeater>

    Logically, it seems very simple. The expected HTML output should be:

    <div id="ctl00_cph_agentRepeater" style="visibility: visible;">
    <table class="datatable">
        <thead>
            <tr>
                <th>Id</th>
                <th>First Name</th>
                <th>Last Name</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><span id="ctl00_cph_agentRepeater$3$0$idSpan">1</span></td>
                <td><span id="ctl00_cph_agentRepeater$3$0$firstNameSpan">Matt</span></td>
                <td><span id="ctl00_cph_agentRepeater$3$0$lastNameSpan">Lehnen</span></td>
            </tr>
        </tbody>
    </table>
    </div>

    However, this is what I get:

    <div id="ctl00_cph_agentRepeater" style="visibility: visible;">
    <table class="datatable">
    <thead>
    <tr>
    <th>Id</th>
    <th>First Name</th>
    <th>Last Name</th>
    </tr>
    </thead>
    <tbody> </tbody>
    </table>
    <span id="ctl00_cph_agentRepeater$3$0$idSpan">1</span>
    <span id="ctl00_cph_agentRepeater$3$0$firstNameSpan">Matt</span>
    <span id="ctl00_cph_agentRepeater$3$0$lastNameSpan">Lehnen</span>
    </div>

    The spans are rendered outside of the table and there is nothing within tbody. Am I doing something wrong?

     

  •  Advertisement

    Featured Advertisement

     
  • 03-12-2009 1:29 PM In reply to

    • xxxd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 19,057

    Re: Repeater rendering troubles

     this is a known issue. Each template, header, item, or footer is treated as a stand alone entity, if the opening tag is not supplied with an ending tag, the rendering will automatically supply which would close the header table.

    And as in the case of item template, since there is no table tag supplied, it is instead rendered outside of a table ...

  • 03-12-2009 1:37 PM In reply to

    • dru987
    • Top 500 Contributor
    • Joined on 03-12-2009
    • Wannabe Slacker
    • Points 13

    Re: Repeater rendering troubles

    thank you for the quick reply. this news is very unfortunate.

Page 1 of 1 (3 items)