asp.net-core-1.0 - aspnet core 1.0.1 taghelper 未在区域中工作

标签 asp.net-core-1.0 tag-helpers

我在 aspnet core 1.0.1 中遇到问题。我在 Views/_ViewImports.cshtml 中添加了标签助手 namespace ,但它在区域 View cshtml 文件中不起作用。如果我手动添加或添加到 Area/View/_ViewImports.cshtml 中,那么它就起作用了。

image attached for reference

最佳答案

您是否已将 _ViewImports.cshtml 添加到适当的级别?这是正常的结构:

enter image description here

现在该区域应如下所示:

enter image description here

并且 _ViewImports.cshtml 文件应该放置在同一级别 - 因此在每个区域的每个 Views 目录中。

关于asp.net-core-1.0 - aspnet core 1.0.1 taghelper 未在区域中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40575531/

相关文章:

asp.net-core - 在 Visual Studio 上以 32 位运行 Asp.Net 核心

c# - ASP.NET MVC 6 中的属性路由正则表达式约束错误

docker - 无法在本地找到图像 'xxxx'

asp.net-core-1.0 - Serilog : How to use logging in 'Class Library' of asp. 网络核心

asp.net-mvc - ASP .Net Core 自定义标记帮助器将 CamelCase 属性转换为空格

asp.net-core - EditorFor Tag Helper 在使用 FluentValidator 时不呈现验证属性

asp.net-core - ASP.NET Core 标记帮助器,用于有条件地将类添加到元素

mysql - 每第二次命中获得 "Access denied for user..."

c# - 自定义标签助手 : How do I use complex objects in attributes?