At this moment, your page is not loading and producing the error:
Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot convert null to 'bool' because it is a non-nullable value type
Source Error:
Line 32: <div class="status-wrapper">
Line 33: <h2 class="sub-title">Collections</h2>
Line 34: @{Model.CollectionVM.FacebookStatus = ViewBag.FacebookStatus;}
Line 35: @Html.Partial("_MiniBookStatus", Model.CollectionVM)
Line 36:
Source File: d:\home\site\wwwroot\Views\Book\Index.cshtml Line: 34
It looks like maybe you did not initialize the ViewBag.FacebookStatus
value in your controller. With those ViewBag values, if you don't set the value in all code paths, then you may have a case like this where the it's null
.
As an example:
protected ActionResult Test()
{
ViewBag.SomeString = string.Empty;
ViewBag.SomeBool = false;
//some code
if (condition)
{
ViewBag.SomeBool = true;
}
else
{
ViewBag.SomeString = "Yea I'm a string!";
}
return View();
}
It's good practice to init the ViewBag values or it can come back to bite you in the Razor view because Intellisense won't pick it up, and it won't cause a build error or warning.