How do you define a multi-line inline template?
For example, this grid has a built-in template (format parameter of the last column). What is the syntax to have multiple html lines in an inline template?
@model List<Employee>
@{
View.Title = "Employee List";
}
@{
var grid = new WebGrid(source: Model,
defaultSort: "FirstName",
rowsPerPage: 3);
}
<p>
<h2>Employee List</h2>
<div id="grid">
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("FirstName"),
grid.Column("LastName"),
grid.Column("Salary",format:@<text>$@item.Salary</text>)
)
)
</div>
</p>
source
share