I tried making a partial view, actually it works but when I tried to put my code in html, I always get a Nullable error. This work :
public PartialViewResult Notification()
{
ViewBag.Notification = db.Notification.ToList();
return PartialView("Notification");
}
@Html.Action("Notification", "Project");
but when I tried to make it like this:
public PartialViewResult Notification()
{
ViewBag.Notification = db.Notification.ToList();
return PartialView("Notification");
}
@Html.RenderPartial("Notification", "Project");
or
@Html.RenderPartial("Notification", "Project");
Such codes give me a Nullable error
Here are my PartialView
@{
foreach (var item in ViewBag.Notification)
{
@item.Name
}
}