Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Professional ASP.NET MVC 3
|
BOOK: Professional ASP.NET MVC 3
This is the forum to discuss the Wrox book Professional ASP.NET MVC 3 by Jon Galloway, Phil Haack, Brad Wilson, K. Scott Allen; ISBN: 978-1-1180-7658-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 3 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 January 5th, 2013, 12:10 AM
Registered User
 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default System.NullReferenceException was unhandled by user code

System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object.
Source=App_Web_gccihxxw
StackTrace:
at ASP._Page_Views_Employee_Index_cshtml.Execute() in c:\Users\roman\Downloads\project download\MvcApplication3\MvcApplication3\MvcApplic ation1\Views\Employee\Index.cshtml:line 47
at System.Web.WebPages.WebPageBase.ExecutePageHierarc hy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.StartPage.RunPage()
at System.Web.WebPages.StartPage.ExecutePageHierarchy ()
at System.Web.WebPages.WebPageBase.ExecutePageHierarc hy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
at System.Web.Mvc.BuildManagerCompiledView.Render(Vie wContext viewContext, TextWriter writer)
at System.Web.Mvc.ViewResultBase.ExecuteResult(Contro llerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActio nResult(ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.<>c__Displa yClass1c.<InvokeActionResultWithFilters>b__19()
at System.Web.Mvc.ControllerActionInvoker.InvokeActio nResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
InnerException:

|
|
\/ error
@foreach (var item in Model)
{
<tr>
<td>
@item.FirstName
</td>
<td>
@item.LastName
</td>
<td>
@if (@item.Designation == 1) {<p>Developer</p> }
</td>
<td>
@item.Salary
</td>
<td>
@item.DateOfJoining.Date.ToShortDateString()
</td>
<td>
@item.EmployeeId
</td>

</tr>
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Listing 1-10 NullReferenceException was unhandled by tomche BOOK: Professional ASP.NET 4 : in C# and VB 1 February 14th, 2012 05:29 PM
System.NullReferenceException was unhandled by user code - Chapter 8 dtmmaxx BOOK: Beginning ASP.NET 4 : in C# and VB 10 September 1st, 2011 05:51 PM
nullreferenceexception was unhandled by user code rnavin BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 0 June 11th, 2011 09:26 AM
ConstraintException was unhandled by user code jcooper0 BOOK: Professional ASP.NET MVC 2 8 February 16th, 2011 09:32 AM
TargetInvocationException was unhandled by user code MattHoff BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 2 October 13th, 2010 11:38 AM





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