Widgets > wijmenu > wijmenu Tutorial > wijmenu Step 2 of 3: Creating the Controller |
Next, we need to create a controller to return the items from the NorthWND.MDF database’s view.
To create the controller, follow these steps:
using [PROJECTNAME].Models;
public class HomeController : Controller
{
NORTHWNDEntities northwind = new NORTHWNDEntities();
public ActionResult Index()
{
ViewBag.Message = "Categories";
var Categories = northwind.Categories.ToList();
foreach (Category c in Categories)
{
c.Products.Load();
return View(categories);
}
public ActionResult About()
{
return View();
}
}
Now that we have created the model and the controller, we can create the view, which will consist of a menu and appear on the homepage of the project, in wijmenu Step 3 of 3: Creating the View and Adding Wijmo Widgets.