1

截屏

我认为截图说明了一切。我该如何解决这个问题?即使数据不为空,它也会给出空引用异常..

堆栈跟踪如下:

   at ASP._Page_Views_Profile_Index_cshtml.Execute() in c:\aaaaaa\aaa\aaaaaa\Views\Profile\Index.cshtml:line 17
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
   at System.Web.WebPages.StartPage.ExecutePageHierarchy()
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)  
4

1 回答 1

0

我打赌线程问题。当 ViewEngine 尝试显示/绑定值(MobilePhone)时,它为 null 并引发异常,但与此同时,负责加载数据的线程完成,并且在调试器中期望/查看值时,该值存在。

于 2012-11-06T15:54:50.917 回答