1

有人可以告诉我这段代码有什么问题吗?编译器抱怨我的 ActionLinks 有什么问题。

  @grid.GetHtml(
columns:=New WebGridColumn() {grid.Column("cubeName"),
                              grid.Column("bracketFilter"),
                              grid.Column("description"),
                              grid.Column("", header:="Action", canSort:=False, format:=@@<text>
                                                                                            @Html.ActionLink("Edit", "Edit", New With {.id = item.cubeid, .appid = item.appid}) |
                                                                                            @Html.ActionLink("Details", "Details", New With {.id = item.cubeid, .appid = item.appid}) |
                                                                                            @Html.ActionLink("Delete", "Delete", New With {.id = item.cubeid, .appid = item.appid})
                                                                                        </text>)},
htmlAttributes:=New With {.class = "tblnAdmin"})
4

1 回答 1

1

对于多行语句,您必须将代码括在括号中。尝试:

  @(grid.GetHtml(
columns:=New WebGridColumn() {grid.Column("cubeName"),
                              grid.Column("bracketFilter"),
                              grid.Column("description"),
                              grid.Column("", header:="Action", canSort:=False, format:=@@<text>
                                                                                            @Html.ActionLink("Edit", "Edit", New With {.id = item.cubeid, .appid = item.appid}) |
                                                                                            @Html.ActionLink("Details", "Details", New With {.id = item.cubeid, .appid = item.appid}) |
                                                                                            @Html.ActionLink("Delete", "Delete", New With {.id = item.cubeid, .appid = item.appid})
                                                                                        </text>)},
htmlAttributes:=New With {.class = "tblnAdmin"}))
于 2013-05-31T17:45:09.837 回答