Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Why abp.nav is null when adding item to context.Manager.Menu #476


User avatar
0
omital created

Hi Every thing work correctly when I use "context.Manager.MainMenu" like this

context.Manager.MainMenu.AddItem(baseTable)

but when I add item to "context.Manager.Menus"

var md = new MenuDefinition("um", new LocalizableString("Persons", ISDConsts.LocalizationSourceName));
            context.Manager.Menus.Add(new System.Collections.Generic.KeyValuePair<string, MenuDefinition>("test", md));

then "abp.nav" in java script file is null


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

    Your menu's name should be same in dictionary and menu definition. Try this:

    var md = new MenuDefinition("um", new LocalizableString("Persons", ISDConsts.LocalizationSourceName)); context.Manager.Menus["um"] = md;

    If not works, see Logs in Web project's Logs folder.

  • User Avatar
    0
    omital created

    Work like a charm. Thank you man :) ;)