I have a query that represents an album that I am trying to display but it errors out on the seccond loop with this error "Object reference not set to an instance of an object" Is there something else I need to do other than having the "Let" statement in
the query in order to fill the child objects with data.
Thanks
<%For
Each album
As AlbumGrid
In ViewData.Model%>
<label
id="Label1"
><%=album.albumName%></label><br
/>
<%For
Each people
As personGrid
In album.people%>
<label
id="Label2"
><%=people.personName%></label>
<%Next%><===Error
<%For
Each track
As TrackGrid
In album.tracks%>
<label
id="Label3"
><%=track.trackName%></label>
<% For
Each tPeople
As personMNR
In track.people%>
<label
id="Label4"
><%=tPeople.personName%></label>
<%Next%>
I am sorry, I apologize. I just had the wrong version of the code. I was up entirely to late. Once I got some sleep and came back and did a search and came up with this.
http://blog.wekeroad.com/blog/lazy-loading-with-the-lazylist/. Problem solved.
Marked as answer by Ruffone on Sep 15, 2008 06:14 PM
Ruffone
Member
567 Points
161 Posts
How do I access lazy values.
Sep 15, 2008 05:47 AM|LINK
I have a query that represents an album that I am trying to display but it errors out on the seccond loop with this error "Object reference not set to an instance of an object" Is there something else I need to do other than having the "Let" statement in the query in order to fill the child objects with data.
Thanks
<%For Each album As AlbumGrid In ViewData.Model%> <label id="Label1" ><%=album.albumName%></label><br /> <%For Each people As personGrid In album.people%> <label id="Label2" ><%=people.personName%></label> <%Next%><===Error
<%For Each track As TrackGrid In album.tracks%> <label id="Label3" ><%=track.trackName%></label> <% For Each tPeople As personMNR In track.people%> <label id="Label4" ><%=tPeople.personName%></label> <%Next%><%
Next%><%
Next%>MVC Framework
Ruffone
Member
567 Points
161 Posts
Re: How do I access lazy values.
Sep 15, 2008 06:09 PM|LINK
I am sorry, I apologize. I just had the wrong version of the code. I was up entirely to late. Once I got some sleep and came back and did a search and came up with this. http://blog.wekeroad.com/blog/lazy-loading-with-the-lazylist/. Problem solved.