Skip to content Skip to sidebar Skip to footer

Html Table Layout When Binding With Asp.net C# Repeater

I have asp repeater which looks like this

Solution 1:

Try Listview

http://weblogs.asp.net/scottgu/archive/2007/08/10/the-asp-listview-control-part-1-building-a-product-listing-page-with-clean-css-ui.aspx

<asp:ListViewID="ContactsListView"DataSourceID="ContactsDataSource"GroupItemCount="2"runat="server"><ItemTemplate>

                        <%# Eval("Username")%>

        </ItemTemplate></asp:ListView>

Solution 2:

A Repeater is a for-loop like structure for rendering markup.

You can accomplish what you're trying to do by using a nested repeater: Outside repeater for <tr>'s and wrap your <td>'s in another repeater.

You can also accomplish this by using asp:DataList control, which is a more elegant solution to what you're trying to do.

Post a Comment for "Html Table Layout When Binding With Asp.net C# Repeater"