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. Image for the cookie policy date

Add multiple sub menus

Hi is it possible to have multiple sub menus in one main menu

Menu--|
            | Sub Menu
Menu 1|
            | Sub Menu 2

Could you show me how to do in Asp.Net MVC View

Thanks

Edmund Herbert

3 Replies

KR Keerthana Rajendran Syncfusion Team August 17, 2017 07:27 AM UTC

Hi Edmund,     
   
Thank you for contacting Syncfusion Support.   
   
Yes, it is possible to have multiple submenu in one main menu. Please refer to the given code   
   
@Html.EJ().Menu("syncfusionProducts").EnableCenterAlign(true).EnableRTL(false).Items(items =>   
               {   
                   items.Add().Url("#").Id("Products").Text("Products").Children(child =>   
                       {   
                           child.Add().Url("").Text("ASP.NET");   
                           child.Add().Url("").Text("Orubase Studio");   
                           child.Add().Url("").Text("Metro Studio");   
                           child.Add().Url("").Text("What's New").Children(child1 =>   
                               {   
                                   child1.Add().Url("").Text("Windows Forms");   
                                   child1.Add().Url("").Text("Windows Phone");   
                                   child1.Add().Url("").Text("ASP.NET").Children(child2 =>   
                                       {   
                                           child2.Add().Url("").Text("ASP.NET MVC");   
                                           child2.Add().Url("").Text("ASP.NET Core");   
                                       });   
                               });   
                       });   
                   items.Add().Url("").Text("Support").Children(child =>   
                       {   
                           child.Add().Url("").Text("Direct-Trac Support");   
                           child.Add().Url("").Text("Services").Children(child1 =>   
                               {   
                                   child1.Add().Url("").Text("Consulting");   
                                   child1.Add().Url("").Text("Training").Children(child2 =>   
                                   {   
                                       child2.Add().Url("").Text("Software");   
                                       child2.Add().Url("").Text("Hardware");   
                                   });    
                               });   
                       });   
                   
                   });   
               })   
   
The menu will be rendered as shown below   
   
   
We have attached a sample for your reference. Please download the sample:    
   
   
Also, check the below links for more details about menu control   
   
   
   
Regards,   
Keerthana.   
 



EH Edmund Herbert August 17, 2017 08:28 AM UTC

Hi thanks for reply I was looking for a solution for Asp.net Core 2.00 not MVC 5

Thanks

Edmund Herbert



KR Keerthana Rajendran Syncfusion Team August 18, 2017 09:23 AM UTC

Hi Edmund,     
Sorry for the inconvenience caused.   
 
We have provided a sample in MVC based on your previous update. Now we have prepared a sample in ASP.NET Core 2.0 for menu. Please download the sample from    
  dotNetCore2   
We have also attached a document to know more details about rendering EJ controls in ASP.Net Core 2.0 . Please download the document from    
   
Regards,   
Keerthana  
 


Loader.
Live Chat Icon For mobile
Up arrow icon