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) –