I'm trying to make a Telerik Kendo grid of audit records, with a sub grid presenting the details of each main record.
I'm getting a syntax error which I don't understand.
@model IEnumerable<AuditRecord>
@(Html.Kendo().Grid(Model)
.Name("AuditGrid")
.DetailTemplate(auditrec =>
{
@<text>
@(Html.Telerik()
.Grid(auditrec.Details)
.Name("Detail_" + auditrec.ID.ToString()))
</text>
}))
Error message follows, with the line @<text>
flagged as the source of the error:
CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
This is modeled after the Telerik example here.
What am I getting wrong about the Razor syntax? The <% syntax isn't working for me, either.
<text>
without the Razor@
– Dave AlperovichCS1646: Keyword, identifier, or string expected after verbatim specifier: @
. If I remove the @ on that line, the error moves back up one line and reads:CS1525: Invalid expression term '<'
– user47589@
identifier inside the block. try removing it. – Dave Alperovich