使用href传递值

时间:2014-06-12 09:07:32

标签: jquery html asp.net-mvc asp.net-mvc-4 jqgrid

我使用以下格式化程序选项在jqgrid.Its的最后一列中添加href按钮工作正常。

       formatter: 
                 function (cellvalue, options, rowObject)
                 {
                  return "a href='@Url.Action("Action", "Controller")?obid='+rowObject[0]+'>View";
                 }

我需要将rowobject值传递给控制器​​中的Action。

我使用上面的方法,我在Action中获取空值。如何将值传递给action?

1 个答案:

答案 0 :(得分:4)

正确使用引号

formatter: function (cellvalue, options, rowObject) {
    return "a href='@Url.Action("Action", "Controller")?obid=" + rowObject[0] + "'>View";
}