Base solution for your next web application
Open Closed

How to Move Navigation Menu using MoveMenuItemAfter #972


User avatar
0
princedis created

Hi Using your great tutorial <a class="postlink" href="https://github.com/aspnetboilerplate/sample-blog-module">https://github.com/aspnetboilerplate/sample-blog-module</a>, 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


4 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    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.

  • User Avatar
    0
    princedis created

    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.

  • User Avatar
    0
    hikalkan created
    Support Team

    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.

  • User Avatar
    0
    princedis created

    That worked, but my modularizatation concept was compermised.