Asp. Net Core project practices-permission management system (5) User logon and core permission management system
0 Asp. Net Core: permission management system (0)
1 Asp. Net Core project practice-permission management system (1) Use AdminLTE to build a front-end
2 Asp. Net Core project practice-permission management system (2) function and entity Design
3. Asp. Net Core: permission management system (3) using PostgreSQL through EntityFramework Core
4 Asp. Net Core project practices-permission management system (4) multi-project hierarchical implementation of dependency injection, warehousing, and services
5 Asp. Net Core project practices-permission management system (5) User Logon
6 Asp. Net Core project practice-permission management system (6) function Management
7 Asp. Net Core project practice permission management system (7) Organization Management
Github Source Code address
0 use of TagHelper
TagHelper is Asp. net Core provides the brand new server code to participate in the creation and rendering of HTML elements. TagHelpers reduces or avoids the display conversion between HTML and C # In the Razor view, it has the following features:
- A friendly Html development experience
The Razor Tag uses Tag Helpers to look more like standard HTML. Front-end designers familiar with HTML, CSS, and JavaScript can edit Razor without learning the C # Razor syntax.
- Provides a rich smart sensing environment to Create HTML and Razor tags
Microsoft. AspNetCore. Razor. Tools provides smart sensing and smart reminders, greatly improving coding efficiency.
- Provide serversMore powerful, more reliable, and maintained code html Rendering Methods
The use of TagHelper is generally placed on the "view import page", and the server reference we will use will be placed on the view import page.
0.0 create view import page
In the Fonour. MVC project, right-click the Views folder, add a new item, select the MVC view import page, and add a view import page named "_ ViewImports. cshtml" by default.
Modify the view import page as follows:
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
0.1 use Microsoft. AspNetCore. Razor. Tools
Microsoft. AspNetCore. Razor. Tools provides SMART awareness prompts and code highlighting for TagHelper.
- Installation through NuGet Package Manager
- Install it on the NuGet package Console
- Directly modify project. json
Microsoft. AspNetCore. Razor. tools appears in the dependencies and Tools configuration sections of the project. json file.
"dependencies": {
"Microsoft.NETCore.App": "1.0.1",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Fonour.Application": "1.0.0-*",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Session": "1.0.0",
"Fonour.Utility": "1.0.0-*"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final"
},
Open the Login/Index. cshtml file and enter a label at will. You can see the asp-for TagHelper prompt.
After creating a complete label with TagHelper, it will be highlighted in bold. You canTools>Option>Environment>Font and colorCustomize the font and color of TagHelperElement.