Wrox Programmer Forums
BOOK: Professional ASP.NET MVC 4
This is the forum to discuss the Wrox book Professional ASP.NET MVC 4 by Jon Galloway, Phil Haack, Brad Wilson, K. Scott Allen; ISBN: 978-1-118-34846-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 22nd, 2013, 11:48 AM
Registered User
Join Date: Oct 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Null Reference Exception

I have been working on the tutorial for this book called Mvc Music Store. I have reached part ten and I have reached an error at the very end of it. The error reads "NullReferenceException: Object reference not set to an instance of an object."

The page that this exception is on reads the following:

"@model List<MvcMusicStore.Models.Album>
ViewBag.Title = "ASP.NET MVC Music Store";
<div id="promotion">
<h3><em>Fresh</em> off the grill</h3>
<ul id="album-list">
@foreach (var album in Model)
<li><a href="@Url.Action("Details", "Store",
new { id = album.AlbumId })">
<img alt="@album.Title" src="@album.AlbumArtUrl" />

Does anybody have any ideas on how to get rid of this exception?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Null Reference exception could occur... jrmrcol Visual Studio 2005 3 March 26th, 2009 01:49 PM
Null reference exception was unhandled labby C# 2005 0 April 24th, 2007 06:14 AM
Null Reference Exception was unhandled labby C# 2005 1 February 9th, 2007 03:15 PM
Null reference exception when using DataAdapter Samantha Karen Webb C# 1 July 21st, 2006 09:12 AM
NULL reference exception Dwizz VB.NET 2002/2003 Basics 3 June 21st, 2005 07:15 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.