We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Performing an action when selecting a menu

Thread ID:

Created:

Updated:

Platform:

Replies:

144575 May 10,2019 07:58 AM UTC May 14,2019 10:04 AM UTC ASP.NET MVC - EJ 2 1
loading
Tags: Menu
Charles Elliott
Asked On May 10, 2019 07:58 AM UTC

I'm trying to get an action to occur when clicking an item in a Blazor menu, however nothing seems to work - something like this:
Can you advise where I'm going wrong please?
public class HomeController : Controller
{
public IActionResult Index()
{
List menuItems = new 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
}
}

Prince Oliver [Syncfusion]
Replied On May 14, 2019 10:04 AM UTC

Hi Charles, 

Thank you for contacting us. 

We have checked your reported issue and we are able to reproduce it in our end. We confirmed this as a defect and logged the defect report for the same. The fix for this issue will be includded in our upcoming EJ2 patch release schedule on last week of May 2019. We appreciate your patience until then. Meanwhile you can track the status of the report through the following feedback portal link. 

Regards, 
Prince 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon