public class HomeController : Controller
{
public IActionResult Index()
{
List
new MenuItem
{
Text = "File",
IconCss = "em-icons e-file",
Items = new List()
{
new MenuItem { Text= "Open", IconCss= "em-icons e-open", Url= "Home/Open" },
new MenuItem { Text= "Save", IconCss= "e-icons e-save", Url= "Home/Save" },
new MenuItem { Separator= true },
new MenuItem { Text= "Exit", Url= "Home/Exit" }
}
},
new MenuItem { Text = "Help" }
};
ViewBag.menuItems = menuItems;
return View();
}
public IActionResult Open()
{
Console.WriteLine("You clicked Open ...................");
Debug.WriteLine("You clicked Open ..................");
Trace.WriteLine("You clicked Open ..................");
return View(); // Triggered for Open click
}
public IActionResult Save()
{
Console.WriteLine("You clicked Save ...................");
Debug.WriteLine("You clicked Save ..................");
Trace.WriteLine("You clicked Save ..................");
return View(); // Triggered for Save click
}
public IActionResult Exit()
{
Console.WriteLine("You clicked Exit ...................");
Debug.WriteLine("You clicked Exit ..................");
Trace.WriteLine("You clicked Exit ..................");
return View(); // Triggered for Exit Click
}
}