引导 Web 应用程序问题 ASP.NET



我正在尝试通过引导程序向我的 Web 应用程序添加一些字形,但以前没有使用过引导程序,我不明白我应该如何做到这一点。有很多关于如何做到这一点的令人困惑的文章,我关注了一些,但没有得到任何结果。到目前为止,我已经使用 NuGet 将引导程序添加到我的项目中。

我查看了我的文件,所有的依赖项和引用都在那里。但是,当我运行项目时,字形仍然没有显示。我已经在下面发布了要显示这些字形的页面的代码。知道我还要做什么才能让他们工作吗?

@page
@model CustomerPageTest.Pages.Customer.ListModel
@{
ViewData["Title"] = "List";
}
<div>
<p align="right">
<a class="btn btn-dark"
asp-page="./AddCustomer">Add New Customer</a>
</p>
</div>
<form method="get">
<div class="form-group">
<div class="input-group">
<input type="search" class="form-control" asp-for="SearchTerm" />
<span class="btn btn-outline-dark">
<i class="glyphicon glyphicon-search"></i>
</span>
</div>
</div>
</form>
<table class="table">
@foreach(var customer in Model.Customers)
{
<tr>
<td>@customer.name</td>
<td>@customer.notes</td>
<td>
<a class="btn btn-outline-dark"
asp-page="/Assessment/AddAssessment" asp-route-customerId ="@customer.customer_id">
<i class="glyphicon glyphicon-plus"></i> 
</a>
</td>
</tr>
}
</table>

您需要将下面的bootstrap.min.css文件放到您的页面上以显示glyphicon。

@page
@model CustomerPageTest.Pages.Customer.ListModel
@{
ViewData["Title"] = "List";
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> 
<div>
<p align="right">
<a class="btn btn-dark"
asp-page="./AddCustomer">Add New Customer</a>
</p>
</div>
<form method="get">
<div class="form-group">
<div class="input-group">
<input type="search" class="form-control" asp-for="SearchTerm" />
<span class="btn btn-outline-dark">
<i class="glyphicon glyphicon-search"></i>
</span>
</div>
</div>
</form>
<table class="table">
@foreach(var customer in Model.Customers)
{
<tr>
<td>@customer.name</td>
<td>@customer.notes</td>
<td>
<a class="btn btn-outline-dark"
asp-page="/Assessment/AddAssessment" asp-route-customerId ="@customer.customer_id">
<i class="glyphicon glyphicon-plus"></i> 
</a>
</td>
</tr>
}
</table>

最新更新