ASP.NET Core Menu Setup

Shield UI Menu for ASP.NET Core is a server-side wrapper component implemented as an ASP.NET Core MVC Helper.

For a detailed guide how to setup Shield UI for your ASP.NET Core project, check out this page.

The ASP.NET Core MVC helper API is a 1:1 mapping of the JavaScript Menu widget configuration, so you only have to get familiar with a single set of configuration options:

// JavaScript Menu initialization
$("#menu").shieldMenu({
    dataSource: {
        data: links
    },
    cls: "topmenu",
    orientation: "horizontal",
    events: {
        click: function (e) {
            console.log(e.item.content + " clicked");
        }
    }
});
// ASP.NET Core Menu initialization
@(Html.ShieldMenu()
    .Name("menu")
    .DataSource(dsb => dsb.Data(@links))
    .Cls("topmenu")
    .Orientation(Shield.Mvc.UI.Menu.MenuOrientationOptions.Vertical)
    .Events(eb => eb.Click(
        @<text>
            function (e) {
                console.log(e.item.content + " clicked");
            }
        </text>)
    )
)

To see the configuration options in action, please refer to our online demos.