![](/img/trans.png)
[英]Adding Bootstrap content folders to ASP.NET Web Application projects
[英]Bootstrap in ASP.NET Web Application Issue
我正在尝试通过引导程序将一些字形图标添加到我的 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 文件放在您的页面下方以显示字形图标。
@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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.