我试图将Bootstrap 4集成到我的应用程序中。在我的_Layout.cshtml文件中,我有以下内容:
<link asp-href-include="~/lib/bootstrap/dist/css/bootstrap.min.css" asp-href-exclude="**/*-reboot*,**/*-grid*" rel="stylesheet" />
我的凉亭配置文件:
{
"name": "asp.net",
"private": true,
"dependencies": {
"bootstrap": "~4.0.0"
}
}
我的_ViewImports.cshtml(在/ Views文件夹中,而不是/ Views / Shared文件夹中)
@addTaghelper *, Microsoft.AspNetCore.Mvc.Taghelpers
我的_Layout.cshtml
文件中有_ViewStart.cshtml
。
使用asp-href-include
和asp-href-exclude
标记时,引导链接似乎无效。不应用引导程序布局。当我使用基本的
<link href="~/lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
在我的_Layout.cshtml
中,应用了Bootstrap但不是我想要的布局。如何集成标记器以获得所需的设计?
答案 0 :(得分:2)
愚蠢的错误,大写TagHelpers中的“H”固定它
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers