This is my code i am getting above said error :
@model IEnumerable
@{
ViewBag.Title = "SearchView";
WebGrid grid = new WebGrid();
}
SearchView
@using (Html.BeginForm("SearchView", "Search", FormMethod.Get))
{
@Html.AntiForgeryToken()
@foreach (var post in Model) {
Html.LabelFor(model => post.clearance_route, new { class = "control-label col-md-2" })
Html.EditorFor(model => post.clearance_route)
Html.ValidationMessageFor(model => post.clearance_route)
}
}
@{
var grid1 = new WebGrid(source: Model, canPage: true, rowsPerPage: 4, defaultSort: "line_segment");
@grid1.GetHtml(tableStyle: "PGrid", headerStyle: "Header", alternatingRowStyle: "altRow", htmlAttributes: new { id = "DataTable" }, columns: grid.Columns(
grid1.Column("clearance_route"),
grid1.Column("line_segment"),
grid1.Column("mile_post"),
grid1.Column("", header: "ToEdit", format: @@Html.ActionLink("Edit", "Edit", "Person", new { id = item.ID }, new { target = "_blank" }) )));
}
@Html.ActionLink("Back to List", "Index")
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}

Midhun TpRank #388 · 6.5K reputationPosted Aug 5, 2016, 8:30 PM EDT
Vanaraj n17 reputationPosted Aug 5, 2016, 9:20 PM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 5, 2016, 10:24 PM EDT