With a product classification management function to write, the code as simple as possible to understand. From the beginning of an entity, until the authority control, from the shallow to deep step to improve the function. 1. Open the language file. \mycompanyname.abpzerotemplate.core\localization\abpzerotemplate\abpzerotemplate-zh-cn.xml "Add 2 key-value pairs, as follows:
<name= "Shop" value= "store"/>< name= "Categorymanager" value= "Classification management"/>
2. Open the file PageNames.cs. \mycompanyname.abpzerotemplate.web\app_start\navigation\pagenames.cs "Add 2 constants under the common class:
Public Const string " Shop " ; Public Const string " Category ";
3. Open the file MpaNavigationProvider.cs. \mycompanyname.abpzerotemplate.web\areas\mpa\startup\mpanavigationprovider.cs "Add the following code below the test menu:
. AddItem (Newmenuitemdefinition (PageNames.App.Common.Shop,//A constant that controls whether the menu is selectedL" Shop"),//menu display name, configured in the language fileIcon"Icon-globe"//Menu Icon). AddItem (NewMenuitemdefinition (//Sub-menuPageNames.App.Common.Category, L ("Categorymanager"), URL:"mpa/category", Icon:"Icon-globe" )) )
4. Build project build project, Refresh page
ASP. Zero--8. An example (1) menu add