I have written an action for a Partial view where I am calling a select list, and have passed same in the _Layout.cshtml.
The dropdown loads on Home/Index action, but the complete website stops working when access any other Action and Controller method.
Home Contoller Action
public IActionResult Index()
{
ViewBag.Proj = new SelectList(db.Projects.ToList(), "ProjectId", "ProjectName");
return View();
}
_Layout.cshtml
@await Html.PartialAsync("~/Views/Home/_partial.cshtml")
I am trying to achieve to get select list and pass it in a form which opens on a button click and which is placed on header menu.