I have list of book titles and I have to list chapters like this.
Title 1
Chapter1
Chapter2
Chapter3
Chapter4
Title 2
Chapter1
Chapter2
So, I have list inside a list. I can get list of books (and titles) but when i reference their chapters i get nothing. well, how can I do that?
<% foreach (var item in Model) { %>
<table>
<tr>
<th></th>
<th>
<%= Html.Encode(item.Text) %>
</th>
</tr>
<% foreach (var chapters in item.Chapter){%>
<tr>
<td>
<%=Html.Encode(chapters.Number)%>
</td>
<td>
<%=Html.Encode(chapters.Text)%>
</td>
</tr>
<% } %>
</table>
<% } %>