Hi Imar,
First of all thank you for this amazing book.
I'm working on my own project now and I'm trying to include the All.aspx page inside AllByGenre.aspx page.
AllByGenres.aspx shows all genres with DisplayMode="Text". Here I changed DisplayMode to "HyperLink" where on browser all reviews are shown as links:
Code:
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<h3><asp:Literal ID="Literal1" runat="server" Text='<%# Eval("Name") %>'></asp:Literal></h3>
<asp:BulletedList ID="ReviewList" runat="server" DataSource='<%# Eval("Reviews") %>' DataTextField="Title" DisplayMode="HyperLink"></asp:BulletedList>
</ItemTemplate>
</asp:Repeater>
Now when I click a review I want to go to the ViewDetails.aspx page and show me the details of that review (Title, Summary and Body):
Code:
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "ViewDetails.aspx?ReviewId=" + Item.Id.ToString() %>' Text='<%# Item.Title%>'></asp:HyperLink>
I tried putting the HyperLink of the All.aspx inside AllByGenres.aspx but is showing something like this:
Code:
System.InvalidCastException: Unable to cast object of type '<>f__AnonymousType0`2[
In AllByGenres.aspx I created another repeater with that HyperLink inside, below the first repeater, but now is showing 'All Reviews' below the 'All Reviews Grouped by Genre'.
Thanks.