Link to home
Start Free TrialLog in
Avatar of zachvaldez
zachvaldezFlag for United States of America

asked on

th doubling up

I have this code but the th headers are duplicating. Perhaps an expert can help.
          <asp:ListView ID="lstIssues" runat="server">
                             <ItemTemplate>
                                 <div>
                                     <table class="responsive">
                                         <thead>
                                             <tr>
                                                 <th>
                                                     Issue
                                                 </th>
                                                 <th>
                                                     Status
                                                 </th>
                                             </tr>
                                         </thead>
                                         <tbody>
                                         <tr><td class="medium-3">
                                            <%#Eval("[ISSUES]")%>                                              
                                             </td>
                                             <td class="medium-2 left">
                                            <%#Eval("ISSUESTATUS")%>                                              
                                             </td>

                                         </tr>
                                             </tbody>
                                     </table>
                                 </div>
                             </ItemTemplate>
             </asp:ListView>

Open in new window

Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Everything inside the <itemTemplate> will be repeated until the end of the Dataset is reached.
The table structure goes inside the <LayoutTemplate> which includes a placeholder for the data produced by the <ItemTemplate>.
          <asp:ListView ID="lstIssues" runat="server">
                              <LayoutTemplate>
                                 <div>
                                     <table class="responsive">
                                         <thead>
                                             <tr>
                                                 <th>
                                                     Issue
                                                 </th>
                                                 <th>
                                                     Status
                                                 </th>
                                             </tr>
                                         </thead>
                                         <tbody>
                                            <tr runat="server" id="itemPlaceholder" ></tr>
                                          </tbody>
                                     </table>
                                 </div>
                             </LayoutTemplate>
                             <ItemTemplate>
                                         <tr runat="server"><td class="medium-3" runat="server">
                                            <%#Eval("[ISSUES]")%>                                              
                                             </td>
                                             <td class="medium-2 left" runat="server">
                                            <%#Eval("ISSUESTATUS")%>                                              
                                             </td>

                                         </tr>
                             </ItemTemplate>
             </asp:ListView>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Tapan Pattanaik
Tapan Pattanaik
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zachvaldez

ASKER

I like both answers and it both work!
I've asked this question before but maybe there is another way to do it. if I click  <%#Eval("[ISSUES]")%> , I'd like to navigate to that record.

In my stored procedure, it includes the field  IssuedID. Can I used the IssuedID to target that record when it navigates. Id like it to display in
Issues.aspx
It's  nice for you to send the link! Thanks