Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Repeater table repeating inside itself

Posted on 2008-11-09
1
Medium Priority
?
590 Views
Last Modified: 2012-05-05
I cannot figure out why my repeater eventually starts nesting table within table producing an outward effect on my page.  The first few rows for SearchResult looks fine but then about the 4th searchresult (parent repeater, I notice it's nesting itself inside the previous table.  The end result is a page that goes way to the right with tables nested inside tables which is not what I want.

    <tr>
        <td>
            <div class="VerticleSpacer"></div>
            <div class="main_body_content">
            <asp:Repeater ID="rptSearchStrings" Runat="server" OnItemDataBound="rptSearchStrings_ItemDataBound">
                <ItemTemplate>
                        <table width="600">
                            <tr>
                                <td class="PagerAlpha_LeftColumn" width="100px">
                                    <asp:HyperLink ID="hypSearchString" Text=<%#Eval("SearchString") %> runat="server" />          
                                </td>
                                <td>
                                    <table>
                                            <asp:Repeater ID="rptProducts" Runat="server" >
                                                <ItemTemplate>
                                                 <tr>
                                                        <td valign="top">
                                                            <img src="<%#WebUtil.ImageUrl(Convert.ToString(Eval("CatImage")), Context.Request.IsSecureConnection)%>" />
                                                        </td>
                                                        <td>
                                                            <%#ShortProductDescription(Convert.ToString(Eval("Description"))) %>
                                                        </td>
                                                 </tr>
                                                </ItemTemplate>                        
                                            </asp:Repeater>
                                    </table>
                                 </td>
                            </tr>
                            <tr><td colspan="2" class="horizontal_line"></td></tr>
                        </table>
                </ItemTemplate>
            </asp:Repeater>
            </div>      
        </td>
    </tr>
0
Comment
Question by:dba123
1 Comment
 
LVL 20

Accepted Solution

by:
informaniac earned 2000 total points
ID: 22919514
Try placing in headertemplate and footertemplate as below
<tr>
        <td>
            <div class="VerticleSpacer"></div>
            <div class="main_body_content">
            <asp:Repeater ID="rptSearchStrings" Runat="server" OnItemDataBound="rptSearchStrings_ItemDataBound">
<HeaderTemplate>
                        <table width="600">
                            <tr>
                                <td class="PagerAlpha_LeftColumn" width="100px">
                                    <asp:HyperLink ID="hypSearchString" Text=<%#Eval("SearchString") %> runat="server" />          
                                </td>
</HeaderTemplate>
                <ItemTemplate>
 
                                <td>
                                    <table>
                                            <asp:Repeater ID="rptProducts" Runat="server" >
                                                <ItemTemplate>
                                                 <tr>
                                                        <td valign="top">
                                                            <img src="<%#WebUtil.ImageUrl(Convert.ToString(Eval("CatImage")), Context.Request.IsSecureConnection)%>" />
                                                        </td>
                                                        <td>
                                                            <%#ShortProductDescription(Convert.ToString(Eval("Description"))) %>
                                                        </td>
                                                 </tr>
                                                </ItemTemplate>                        
                                            </asp:Repeater>
                                    </table>
                                 </td>
                            </tr>
                            
                </ItemTemplate>
<FooterTemplate>
<tr><td colspan="2" class="horizontal_line"></td></tr>
                        </table>
</FooterTemplate>
            </asp:Repeater>
            </div>      
        </td>
    </tr>

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Loops Section Overview
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question