@if (Model.LastOrder != null)
{
<h3>Lorem ipsum:</h3>
}
else
{
<h3>Lorem lorem!</h3>
} -> here occurs error
With this code, I get an error nullreferenceexception. Everything can be easily resolved, but an error occurs ... the last bracket! Very strange .. and what's more - nothing special about the error information to help me.
Why am I getting this error?
Here is my controller action:
[Authorize]
public ActionResult Dashboard()
{
XYZ toReturn = new XYZ { };
return View(toReturn);
}
source
share