I have an ASP.NET ListView control (see below).
Unfortunately, when a ListView control is rendered is does so absent of HTML tags such as THEAD/TBODY.
This is causing a problem for me because the CSS styling that I'm using needs those tags.
<asp:ListView ID="ListView" runat="server" DataKeyNames="Id">
<LayoutTemplate>
<div id="tableContainer" class="tableContainer">
<table runat="server" class="scrollTable" >
<thead class="fixedHeader">
<tr>
<th>
<span>Column1</span>
</th>
</tr>
</thead>
<tbody class="scrollContent">
<tr id="itemPlaceholder" runat="server" />
</tbody>
</table>
</div>
</LayoutTemplate>
<ItemTemplate>
<tr id="items" runat="server">
<td class="first">
<%#Eval("Column1")%>
</td>
</tr>
</ItemTemplate>
</asp:ListView>
Any way I can get those tags to render?
I'm looking for a clean solution and I am open to using jQuery Prepend/Append (if possible) to achieve success.
It is cause you mark table as runat element
<table runat="server" class="scrollTable" >
May be ASP.NET Forms framework realization causes a parsing of table content with removing "thead" tags.
Try to realize your layout without marking table tag with runat="server". I tried it and thead tag is rendered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With