我无法在 Kendo Grid 客户端模板中获取 RouteUrl 值。出于某种原因,请参阅下面的代码,它显示的是同一页面,而不是使用 ID 调用列表详细信息页面
@(Html.Kendo().Grid<SharedListingViewModel>()
.Name("listing-grid")
.Columns(columns =>
{
columns.Bound(x => x.Id)
.ClientTemplate("<a href='" + Url.RouteUrl("Listing", new { listingId = "#= Id #", SeName = "#= SeName #" }) + "'" + ">Show Details</a>");
);
columns.Command(command => { command.Destroy(); }).Width(160);
})
.Editable(x =>
{
x.Mode(Kendo.Mvc.UI.GridEditMode.InLine);
})
.Pageable()
.Sortable()
.Scrollable()
//.HtmlAttributes(new { style = "height:430px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(x => x.Id))
.Read(read => read.Action("FavoritesList", "MemberProfile"))
.Destroy(destroy => destroy.Action("FavoritesDelete", "MemberProfile"))
)
)