我正在尝试用ViewBag.ModuleId命名我的KendoUI网格,我收到错误。我该怎么做呢。
@(Html.Kendo().Grid<TimeSheetSummaryViewModel>()
.Name("grid-timesheetsummary-" + ViewBag.ModuleId)
.DataSource(datasource => datasource.Ajax()
.Read(read => read.Action("GetReport", "Reporting"))
)
.AutoBind(true)
)
Visual Studio在Ajax()上显示红色卷曲,说“无法解析符号Ajax”
答案 0 :(得分:4)
我通过将其转换为(字符串)
找到了解决方案@(Html.Kendo().Grid<TimeSheetSummaryViewModel>()
.Name("grid-timesheetsummary-" + (String) ViewBag.ModuleId)
.DataSource(datasource => datasource.Ajax()
.Read(read => read.Action("GetTimeSheetSummary", "Reporting"))
)
.AutoBind(true)
)