0

在我看来,我有这段代码:

columns.Bound(o => o.jobname).Width(100);
columns.Bound(o => o.objid)
     .Format(Ajax.ActionLink("delete", "QuotesDelete", new { id = "{0}" }, new { @class = "delete-link" })
     .ToHtmlString())
     .Encoded(false)
     .Title("");

现在我想使用jobname列作为编辑链接,所以我将 jobname 更改为以下内容。

columns.Bound(o => o.jobname).Format(Ajax.ActionLink("{0}", "QuotesDetail", new { id = "is-it-possible-to-get-objid-value" })
         .ToHtmlString())
         .Encoded(false);

是否可以在routeValues中获取objid值?

4

1 回答 1

0

如果您需要使用Format. Format 实际上是 string.Format 的快捷方式。如果您想要完全访问权限,请考虑设置列的模板(客户端或服务器)。这是一个例子:

columns.Bound(o => o.objid).Template(@Ajax.ActionLink("Delete", "QuotesDetail", new { id = @item.objid}));
于 2011-03-03T14:01:03.230 回答