2016-11-13 60 views
2

我在aspnet核心1.0.1中遇到问题。我在Views/_ViewImports.cshtml中添加了标签助手名称空间,但它在区域视图cshtml文件中不起作用。如果我手动添加或添加到Area/View/_ViewImports.cshtml那么它的工作。aspnet核心1.0.1 taghelper未在区域工作

image attached for reference

回答

2

你有没有在适当的水平增加_ViewImports.cshtml?这是正常的结构:

enter image description here

现在它应该看起来像区域:

enter image description here

而且_ViewImports.cshtml文件应在同一水平放置在 - 所以在各查看每个区域的目录。

+0

我更新了问题并添加了图像。 – Ahmar

+0

我也注意到'Views/_Layout'也不能在区域视图中工作。 – Ahmar