Nerd Dinner tutorial question (can't pull data off Model)

Posted by Alexander on Stack Overflow See other posts from Stack Overflow or by Alexander
Published on 2010-04-17T18:40:12Z Indexed on 2010/04/17 18:43 UTC
Read the original article Hit count: 260

Filed under:
|
|

I am just following the tutorial about NerdDinner and was stuck because when I am implementing the "Index" View Template I got no data from it. It seems that when I loop around in the code below:

<asp:Content ID="Title" ContentPlaceHolderID="TitleContent" runat="server">
Upcoming Dinners
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="MainContent" runat="server">

<h2>Upcoming Dinners</h2>

<ul>
<% foreach (var dinner in Model) { %>

<li>    
<%=Html.ActionLink(dinner.Title, "Details", new { id=dinner.DinnerID }) %>
on
<%=Html.Encode(dinner.EventDate.ToShortDateString())%>
@
<%=Html.Encode(dinner.EventDate.ToShortTimeString())%>
</li>

<% } %>
</ul>
</asp:Content>

There seems to be nothing in the Model... why is this? I am pretty sure there's data in the database because the details view template worked. FYI I am following the tutorial up to this page

© Stack Overflow or respective owner

Related posts about nerddinner

Related posts about ASP.NET