<asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <asp:Repeater ID="ReviewRepeater" runat="server" DataSource='<%# Eval("Reviews") %>' ItemType="ELibraryModel.Review"> <ItemTemplate> <div class="new_prod_box"> <a><asp:Label ID="DescriptionLabel" runat="server" Text='<%# Item.Title %>' /></a><br /> <div class="new_prod_bg"> <a><asp:HyperLink ID="HyperLink1" CssClass="thumb" runat="server" ImageUrl='<%# String.Format("../Images/books/{0}.jpg", Item.Id.ToString()) %>' Text='<%# Item.Title %>' NavigateUrl='<%# "../books/bookdetails.aspx?reviewId=" + Item.Id.ToString() %>'></asp:HyperLink></a> </div> </div> </ItemTemplate> </asp:Repeater> </ItemTemplate> </asp:Repeater>
using (ELibraryEntities entities = new ELibraryEntities()) { var allBooks = from books in entities.Books.Include("Reviews") orderby books.Category select new { books.Reviews}; Repeater1.DataSource = allBooks; Repeater1.DataBind(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)