CS1646: Keyword, identifier, or string expected after verbatim specifier: @
My .cshtml code is as follows:
@model IEnumerable<PosPayAndBankRec.Domain.Models.ORTBank>
@using Kendo.Mvc.UI.Fluent
@functions {
private void BankGridCommandDef(GridColumnFactory<PosPayAndBankRec.Models.BankListItem> columns)
{
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(180);
columns.Bound(p => p.BankID).Hidden();
columns.Bound(p => p.BankName);
columns.Bound(p => p.BankName);
columns.Template(@<text>
@(Html.ActionLink("Edit", "Details", "Account", new {id = @item.BankID}))
</text>);
}
private void BankGridDataSource(DataSourceBuilder<PosPayAndBankRec.Models.BankListItem> dataSource)
{
dataSource.Ajax()
.Model(AjaxBankDataSourceBuilder)
.Sort(sort => sort.Add(p => p.BankName))
.ServerOperation(true)
.Create(create => create.Action("Create", "Bank"))
.Read(read => read.Action("Read", "Bank"))
.Update(update => update.Action("Update", "Bank"))
.Destroy(destroy => destroy.Action("Delete", "Bank"));
//.Events(e => e.Error("error"));
}
private void AjaxBankDataSourceBuilder(DataSourceModelDescriptorFactory<PosPayAndBankRec.Models.BankListItem> model)
{
model.Id(p => p.BankID);
model.Field(p => p.BankName);
}
private void BankGridToolBarDef(GridToolBarCommandFactory<PosPayAndBankRec.Models.BankListItem> toolbar)
{
toolbar.Create().Text("New Bank");
}
}
@{ ViewBag.Title = "Banks"; }
@(Html.Kendo().Grid<PosPayAndBankRec.Models.BankListItem>()
.Name("Banks")
.Columns(BankGridCommandDef)
.DataSource(BankGridDataSource)
.ToolBar(BankGridToolBarDef)
.Editable(c => c.Mode(GridEditMode.InLine).Enabled(true).DisplayDeleteConfirmation(true))
.Sortable()
.Pageable(p => p.Enabled(false))
.Scrollable(s => { s.Height(400); s.Virtual(true); })
)