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

Dynamic Navigation #951


User avatar
0
Hasan created

Hello Team

I would like to show the Menu based on the Feature.

How to achieve that ?

.AddItem(new MenuItemDefinition( PageNames.App.Tenant.Connect, L("Connect"), "fa fa-connectdevelop", requiredPermissionName: AppPermissions.Pages_Tenant_Connect )


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

    Have you tried to set featureDependency property of the menu item?

  • User Avatar
    0
    Hasan created

    How to Set it ?

    Please show me a example

    Thanks

  • User Avatar
    0
    hikalkan created
    Support Team
    new MenuItemDefinition(
        PageNames.App.Common.Roles,
        L("Roles"),
        url: "roles",
        icon: "icon-briefcase",
        requiredPermissionName: AppPermissions.Pages_Administration_Roles,
        featureDependency: new SimpleFeatureDependency("MyFeatureName")
        )
    
  • User Avatar
    0
    econmedia created

    Hi, I'm interested on how to implement IFeatureDependency interface for this purpose. Can you show us an example?

    Thanks :)

  • User Avatar
    0
    econmedia created

    new Abp.Application.Features.SimpleFeatureDependency("MyFeatureName");

    Found it :)