Open Closed

How to Move Navigation Menu using MoveMenuItemAfter #972


0
princedis created

Hi Using your great tutorial https://github.com/aspnetboilerplate/sample-blog-module, I build my own module, and my menu "Odyssey" shows above the default "Dashboard".

How can I push my menu "Odyssey" just as 2nd one, i.e between **Dashboard**and Administration

image


4 Answer(s)
  • 0
    hikalkan created

    Hi,

    context.Manager.MainMenu.Items.MoveMenuItemAfter("Odyssey", PageNames.App.Tenant.Dashboard);
    

    I assume your menu item's unique name is "Odyssey". This code should go after your menu is created (in AppNavigationProvider).

    Have a nice day.

  • 0
    princedis created

    image image image image did, but error. On tracing I understood that the "Odyssey" is the first item in the list and the dashboard menu item is yet to be generated.

  • 0
    hikalkan created

    You should write this code in your application's navigationprovider, not module's. Because, probably your module is initialized before dashboard menu item is created. When this code runs, both menu items should be exist.

  • 0
    princedis created

    That worked, but my modularizatation concept was compermised.