我有一个带有 ActionLinks 的表格。我正在尝试找出如何包装这些,以便我可以显示 Bootstrap 弹出窗口功能。任何帮助表示赞赏!
以下是我在尝试进行任何更改以允许 Bootstrap-Popover 功能之前所做的操作:
<div class ="container">
<table class="table table-striped table-bordered">
<tr>
<th></th>
<th></th>
<th>Group Name</th>
<th>Description</th>
<th>Last Change</th>
</tr>
<% foreach (var item in Model) { %>
<tr>
<td>
<% if (isAdmin) { %><%=Html.ActionLink("Edit", "Edit", new { id = item.GroupId }, new { @class = "fa fa-pencil", title = "Edit Group" })%>
</td>
<td><%= Html.ActionLink("Details", "Details", new { id=item.GroupId }, new { @class = "fa fa-info_circle", title = "Group Details"})%></td>
<td><%= Html.Encode(item.GroupName) %></td>
<td><%= Html.Encode(item.Description) %></td>
<td><%=Html.Action("ConvertToLocalTime", new {utcTime = item.LastChange})%></td>
</tr>
<% } %>
</table>
</div>
最佳答案
我知道这个问题很老了,但我最终还是来到了这里。所以,这就是我得到的。也许我可以帮助别人。
工具提示和弹出窗口数据 API 是可选的,这意味着您必须自己初始化它们。
<script type="text/javascript">
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
然后,在您的代码中:
@Html.ActionLink(" ", "Delete", null, new { id = item.id}, new { @class = "glyphicon glyphicon-remove", data_toggle ="tooltip", data_placement = "top", title = "Delete" })
关于asp.net-mvc - 如何在 MVC 中的 Html ActionLink 上获取 Bootstrap 弹出窗口功能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28728094/