【发布时间】:2016-09-21 04:00:44
【问题描述】:
在下面的代码中,我想在“动物名称”之后包含一个 Bootstrap 字形图标。
@Ajax.ActionLink("Animal Name", "_Index", new { sortOrder = ViewBag.NameSortParam, searchString = Request["searchString"] }, new AjaxOptions
{
HttpMethod = "GET",
UpdateTargetId = "PartialTable",
InsertionMode = InsertionMode.Replace
})
有可能吗??如果不可能,是否有任何其他替代解决方案,例如:
<a href="@Url.Action("Index", "Animal", new {sortOrder = ViewBag.NameSortParam, searchString = Request["searchString"] })">
<span style="font-size:18px">Animal Name</span>
<i class="glyphicon glyphicon-triangle-bottom"></i>
</a>
这被用作将 Bootstrap Glyphicons 与 @Html.ActionLink() 方法一起使用的替代方法!
【问题讨论】:
-
不,不可能使用
ActionLink()。另一种方法是编写您自己的扩展方法 -
谢谢!!是否使用 $.ajax() 方法??
-
没有。你需要自己编写
HtmlHelper扩展方法来生成你想要的html -
明白了!!谢谢!!
标签: c# jquery ajax asp.net-mvc asp.net-ajax