Asp.Net Core 2.0 MVC锚标记助手不起作用

编程入门 行业动态 更新时间:2024-10-09 20:23:24
本文介绍了Asp.Net Core 2.0 MVC锚标记助手不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试创建演示页面,但无法解决下一个问题,因此我尝试了在网上找到的所有内容。 我有一个带有标签助手的锚标签:

I am trying to create a demo page, and can't solve the next problem, and I tried everything what I found on the web. I have an anchor tag with tag helper:

<a class="menu-link" asp-area="" asp-controller="Telefon" asp-action="Index">Telefonok</a>

我还添加了 _ViewImports.cshtml ,并在其中添加了在网上 @addTagHelper *,Microsoft.AspNet.Mvc.TagHelpers 中看到了,但是我仍然遇到错误:名称'addTagHelper'在当前不存在

I also added a _ViewImports.cshtml and in it I added as I saw in the net @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers", but I still got an error: The name 'addTagHelper' does not exist in the current context

我怎么了?!

推荐答案

有两个_ViewImports.cshtml,您可能需要一个位于Views文件夹中的。

There are two _ViewImports.cshtml, you probably need the one located in the Views Folder.

在我的项目中,我在视图/管理下还有另一个

In my project I have a another one under Views/Manage

而且所需的行应如下:

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

我相信这意味着它将包含名称空间中的所有Tag Helpers。

This I believe means it will include all of the Tag Helpers in the namespace.

请注意使用Asterix(*)

Note the use of the Asterix (*)

更多推荐

Asp.Net Core 2.0 MVC锚标记助手不起作用

本文发布于:2023-11-03 05:14:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1554317.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标记   不起作用   助手   Net   Asp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!