Question: I have one layout and one partial view which are in the Shared folder. Partial view presents top menu items which are not static. So I need to call an action method to get menu items from database. To do this, I created a controller and add an action method in it.

When I try to browse the page in web browser, this error occured:

*The controller for path '/' was not found or does not implement IController.*

**Note:**
I tried Html.RenderAction, Html.Partial methods too...
And I tried to create another view folder, and create a new partial view and new controller that named with "folder name + Controller" suffix.

**Layout:**

```
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
</head>
<body>
    <div id="header">
        @Html.Action("~/Views/Shared/_TopMenu.cshtml", "LayoutController", new {area =""}); //Here is the problem.

    </div>
   <div>
        @RenderBody();
   </div>

</body>
</html>

```

**\_TopMenu.cshtml:**

```
@model IList<string>

@foreach (string item in Model)
{
    <span>item</span>
}

```

**LayoutController (in Controllers folder):**

```
 public class LayoutController : Controller
    {
        //
        // GET: /Shared/
        public ActionResult Index()
        {
            return View();
        }

        [ChildActionOnly]
        [ActionName("_TopMenu")]
        public ActionResult TopMenu()
        {
           IList<string> menuModel = GetFromDb();
           return PartialView("_TopMenu", menuModel);
        }    
    }

```

Answer: 
What happens if you put this in your view?

```
@{ Html.RenderAction("TopMenu", "Layout"); }

```

(And comment this out until everything works: //[ChildActionOnly])
This is how I did it: 

**Layout**

```
@Html.Action("GetAdminMenu", "AdminMenu")

```

**Admin Menu Controller**

```
public PartialViewResult GetAdminMenu()
{
    var model = new AdminMenuViewModel();

    return PartialView(model);
}

```

**GetAdminMenu.cshtml**

```
@model ReportingPortal.Models.AdminMenuViewModel

<div class="form-group">
    <label class="col-md-4 control-label" for="selectbasic">School Name</label>
    <div class="col-md-8">
        @Html.DropDownListFor(model => model.SelectedID, new SelectList(Model.DataList, "Value", "Text", Model.SelectedID), "", new { @class = "form-control", @required = "*" })
    </div>
</div>

```