title: System.NullReferenceException in App_Web_*.dll
body: <p>I am having an odd issue.</p>
  
  <p>My MVC application seems to be working perfectly fine except for one view page.</p>
  
  <p>The view page in question (Organization/Edit) gets a 'NullReferenceException' on every code item on the page. Whether it is <strong>Html.TextBoxFor()</strong> or <strong>HTML.AntiForgeryToken()</strong>.</p>
  
  <p>I have my model, view, and controller laid out here on another question that i think is related -- <a href="https://stackoverflow.com/questions/26475866/dropdownlistfor-null-reference-error">https://stackoverflow.com/questions/26475866/dropdownlistfor-null-reference-error</a></p>
  
  <p>As you can see below, my <strong>model</strong> does have information inside of it. This screen capture was taken at the "<strong>Return View("Edit", model)</strong>" inside the controller.</p>
  
  <p><strong>Exception Details</strong></p>
  
  <pre><code>- Source = App_Web_zu4jlld0
  - StackTrace =    at ASP._Page_Views_Organization_Edit_vbhtml.Execute() in C:\Users\mtaylor\Projects\Check Im Here\mtaylor-branch\CheckImHere_v2\CheckImHereMVC\Views\Organization\Edit.vbhtml:line 16
     at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
     at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
     at System.Web.WebPages.StartPage.RunPage()
     at System.Web.WebPages.StartPage.ExecutePageHierarchy()
     at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
     at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
     at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
     at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
     at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
     at System.Web.Mvc.ControllerActionInvoker.&lt;&gt;c__DisplayClass1a.&lt;InvokeActionResultWithFilters&gt;b__17()
     at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/0vId8.png" alt="enter image description here"></p>
  
  <p><strong>View</strong></p>
  
  <pre><code>@ModelType CheckImHereMVC.OrganizationEditViewModel
  
  @Using Html.BeginForm("Edit", "Organization", FormMethod.Post)
   @Html.AntiForgeryToken() 'get errors here
   @Html.ValidationSummary(True) 'get errors here
   @Html.TextBoxFor(Function(model) model.organizationSub.subName, New With {.class = "span12"}) 'and errors here
  End Using
  </code></pre>
  
  <p>One thing i notice is that if i comment out my 'textboxfor', my error will occur at the 'ValidationSummary()', if i comment out my 'ValidationSummary()', then my error will occur at 'AntiForgeryToken()'.</p>
  
  <p>So it seems that the error just happens at the last possible code area.</p>