0

Trying to add some new menu items as per here with the following code:

private void Add_MenuGroup()
{
    Manager.Menu.Add(new Manager.MenuGroup()
    {
        InternalId = "HireModules",
        Name = "Hire Modules",
        CssClass = "fancy-icon"
    });
}

private void Add_MenuItems()
{
    Manager.Menu.Where(m => m.InternalId == "HireModules").Single().Items.Add(
       new Manager.MenuItem()
       {
           Name = "Products",
           Action = "productlist",
           Controller = "products",
           Permission = "ADMIN_PRODUCT",
           SelectedActions = "productlist,productedit"
       });
}

The calls to these methods are in the Global.asax.cs and are being called without error but no new items are being added. How do I fix this?

I can see the items in the list as well.

Laurel
  • 5,965
  • 14
  • 31
  • 57
amun1000
  • 453
  • 1
  • 8
  • 18

2 Answers2

0

Make sure you specify an existing controller

amun1000
  • 453
  • 1
  • 8
  • 18
0

The example uses a custom permission, "ADMIN_PRODUCTS" that doesn't exist in your database. That's why the items are not showing. Remove the permission or add it in the manager interface!

Laurel
  • 5,965
  • 14
  • 31
  • 57
Håkan Edling
  • 2,723
  • 1
  • 12
  • 15