1、在Views文件夹下面新建 Razor视图导入 文件 _ViewImports.cshtml

2、在_ViewImports.cshtml文件中输入 @addTagHelper "*,Microsoft.AspNetCore.Mvc.TagHelpers", 这样全局都可以使用TagHelper了。

3、在_Layout.cshtml文件中加入下面内容,

4、在launchSettings.json文件中修改模式即可

1、在Views文件夹下面新建 Razor视图导入 文件 _ViewImports.cshtml
2、在_ViewImports.cshtml文件中输入 @addTagHelper "*,Microsoft.AspNetCore.Mvc.TagHelpers", 这样全局都可以使用TagHelper了。
3、在_Layout.cshtml文件中加入下面内容,
4、在launchSettings.json文件中修改模式即可
本文标题:TagHelpers简单使用
本文链接:https://www.haomeiwen.com/subject/mafwihtx.html
网友评论