Quick Asp.Net ListView Template
I find that I seem to make the same Asp.Net ListView and internal table html code over and over. The below code contains that table where each row of data corresponds will be bound to each row of data in a database. Here is that template with blank values which will need to be filled in:
<asp:ListView ID="lvXXXXX" DataKeyNames="" runat="server" ItemPlaceholderID="PlaceHolder1"> <LayoutTemplate> <table class=""> <thead> <tr> <th>Header 1</th> </tr> </thead> <tbody> <asp:PlaceHolder runat="server" ID="PlaceHolder1" /> </tbody> </table> </LayoutTemplate> <ItemTemplate> <tr> <td><asp:Label ID="lblYYYY" runat="server" Text='<%# Eval("") %>'/> </td> </tr> </ItemTemplate> </asp:ListView>
Check out my other article which discusses how to use a CheckBox and retrieve data row IDs from the Listbox on the CheckBoxe’s OnChange event! Click the link to the left of this text.
asp.net, c#,javascript…
[…]Quick Asp.Net ListView Template « OmegaMan's Musings[…]…