预期结束。 VB.NET Razor

时间:2013-05-31 16:16:49

标签: vb.net razor

有人能告诉我这段代码有什么问题吗?编译器抱怨我的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"})

1 个答案:

答案 0 :(得分: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"}))