【问题标题】:Razor MVC 3 RC2 - WebGrid Actionlink with Dynamic TextRazor MVC 3 RC2 - 带有动态文本的 WebGrid Actionlink
【发布时间】:2013-03-04 01:41:17
【问题描述】:

我正在输出一个带有动态链接文本的 WebGrid 中的 Actionlink,我可以让它工作的唯一方法如下:

Grid.Column(header: "Subject", columnName: "Message.Subject", format:(item) => Html.ActionLink(((object)item.Message.Subject).ToString(), "Message", new {Id = 12345 }))

有人有更好的方法吗?

【问题讨论】:

    标签: asp.net-mvc-3


    【解决方案1】:

    差别不大。

    Grid.Column(
        header: "Subject",
        columnName: "Message.Subject",
        format: (item) => Html.ActionLink(
            (string)item.Message.Subject, "Message", new { Id = 12345 }
        )
    )
    

    见:How to make a MVC 3 Webgrid with checkbox column?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多