1

ScreenShot

I think the screenshot explains everything. How can i resolve this problem ? Even the data is not null, it gives null reference exception..

Stacktrace is below:

   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)  
14
  • Hit view detail and drill down into the exception, maybe can point you (and us) in the right direction. Commented Nov 6, 2012 at 15:50
  • The inner exception is null it says :S Commented Nov 6, 2012 at 15:54
  • 4
    Looking at how Visual Studio hightlighted the code it seems that the issue is elsewhere and it is pointing to this place by error. Try cleaning the solution (from the properties menu), recompiling. Commented Nov 6, 2012 at 15:55
  • Cleaning the solution and recompiling it did not work :( Commented Nov 6, 2012 at 15:56
  • 1
    try to comment this line (@* *@) so we can make sure the error is there. Commented Nov 6, 2012 at 16:01

1 Answer 1

0

I'm betting for a threading issue. When the ViewEngine tries to display/bind the value(MobilePhone) it's null and it throws the exception but in the meantime the thread responsible for loading the data finishes and when expecting/viewing the value in the debugger the value is present.

Sign up to request clarification or add additional context in comments.

1 Comment

Well actually I'm not loading any data right there. I just put user data which consists of simple properties such as integer and string and showing them...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.