Object reference not set to an instance of an object.
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
Line 8:
Line 9: <h2>Browsing Genre: <%= Model.Genre.Name%></h2> Line 10: <ul>
Line 11: <%foreach(var albums in Model.Albums){ %>
pchindhade
Member
97 Points
93 Posts
Error in Sample application of MVC Music store
Apr 03, 2012 10:16 AM|LINK
Hi
I am new to MVC. and i am trying my hand on it with MVCMusicstore sample application.
I have developed according to steps shown. But at
More complex ViewModels for Store Browse and Index
this point i am getting error in Browse.aspx method on following line.
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Browsing Genre: <%= Model.Genre.Name %></h2> <ul> <% foreach (var album in Model.Albums) { %> <li><%= album.Title %></li> <% } %> </ul> </asp:Content>Error is:
Object reference not set to an instance of an object.
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> Line 8: Line 9: <h2>Browsing Genre: <%= Model.Genre.Name%></h2> Line 10: <ul> Line 11: <%foreach(var albums in Model.Albums){ %>Please help..
Bieters
Member
229 Points
48 Posts
Re: Error in Sample application of MVC Music store
Apr 03, 2012 10:22 AM|LINK
Are you using the latest version of MvcMusicStore?
Seems like you are not using razor zyntax.
pchindhade
Member
97 Points
93 Posts
Re: Error in Sample application of MVC Music store
Apr 03, 2012 10:32 AM|LINK
i am using MVC2.
Young Yang -...
All-Star
21740 Points
1825 Posts
Microsoft
Re: Error in Sample application of MVC Music store
Apr 10, 2012 02:16 AM|LINK
Hi
Please make sure that you are inherits from the Model.
Hope this helpful
Regards
Young Yang
Feedback to us
Develop and promote your apps in Windows Store