1
嗨,有人可以快速查看附件,看看为什么按钮没有正确拾取引导类。动作链接没有拿起在asp.net mvc视图中的引导按钮类
问题中的Actionlink项目位于视图的最后。
我已经尝试将@section脚本部分移动到页面的不同部分,但它没有区别。
感谢 约翰
@model IEnumerable<IWA_Mileage_Tracker_Demo.Models.Journey>
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.StartAddress)
</th>
<th>
@Html.DisplayNameFor(model => model.FinishAddress)
</th>
<th>
@Html.DisplayNameFor(model => model.DateofJourney)
</th>
<th>
@Html.DisplayNameFor(model => model.distance)
</th>
<th>
@Html.DisplayNameFor(model => model.ReasonForJourney)
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.StartAddress)
</td>
<td>
@Html.DisplayFor(modelItem => item.FinishAddress)
</td>
<td>
@Html.DisplayFor(modelItem => item.DateofJourney)
</td>
<td>
@Html.DisplayFor(modelItem => item.distance)
</td>
<td>
@Html.DisplayFor(modelItem => item.ReasonForJourney)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
@Html.ActionLink("Details", "Details", new { id = item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id = item.ID })
</td>
</tr>
}
</table>
<div class="col-md-6">
@Html.ActionLink("Add a new journey", "Create", new {@class = "btn btn-default"})
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
刚添加Layout =“〜/ Views/Shared/_Layout.cshtml”;参考列表包括Bootstrap脚本@ Scripts.Render(“〜/ bundles/jquery”) @ Scripts.Render(“〜/ bundles/bootstrap”) @RenderSection(“scripts”,required:false) –