Asp.net mvc 如何处理wierd列格式

Asp.net mvc 如何处理wierd列格式,asp.net-mvc,webgrid,Asp.net Mvc,Webgrid,我的webgrid中有以下内容: grid.Column(header: "Action", format: delegate(dynamic i) { return Ajax.ActionLink("Remove", "SomeAction", new {dataId = @i.id}, new AjaxOptions

我的webgrid中有以下内容:

grid.Column(header: "Action", 
        format: delegate(dynamic i)
                {
                    return Ajax.ActionLink("Remove", "SomeAction", new {dataId = @i.id},
                                new AjaxOptions
                                    {
                                        InsertionMode = InsertionMode.Replace,
                                        UpdateTargetId = "ropeDiv"
                                    });
                }
        )
我想把这个专栏的内容用DIV括起来。。。然而,我一直没能做到这一点。我可以做一个简单的简单格式,我不需要一个代表。。。我见过很多简单的格式。然而,我所看到的一切都没有给我一个答案

我试过这个:

grid.Column(header: "Action", 
        format: @<DIV> delegate(dynamic i)
                {
                    return Ajax.ActionLink("Remove", "SomeAction", new {dataId = @i.id},
                                new AjaxOptions
                                    {
                                        InsertionMode = InsertionMode.Replace,
                                        UpdateTargetId = "ropeDiv"
                                    });
                }
                </DIV>
        )
grid.Column(标题:“操作”,
格式:@delegate(动态i)
{
返回Ajax.ActionLink(“Remove”,“SomeAction”,new{dataId=@i.id},
新选择
{
InsertionMode=InsertionMode.Replace,
UpdateTargetId=“ropeDiv”
});
}
)
这不管用

有什么想法吗?

根据您的想法,您可以尝试以下方法:

grid.Column(header: "Action",
  format: @<div>@Ajax.ActionLink("Remove", "SomeAction", new{dataId=item.Id},
    new AjaxOptions
    {
      InsertionMode = InsertionMode.Replace,
      UpdateTargetId = "ropeDiv"
    })</div>
)
grid.Column(标题:“操作”,
格式:@@Ajax.ActionLink(“删除”,“某些操作”,新建{dataId=item.Id},
新选择
{
InsertionMode=InsertionMode.Replace,
UpdateTargetId=“ropeDiv”
})
)