I have a List<> binded with some data in Controller action and I want to pass that List<> to View to bind with DataGrid in Razor View.
I am new to MVC.Can any
Passing data to view is simple as passing object to method. Take a look at Controller.View Method
protected internal ViewResult View(
Object model
)
Something like this
//controller
List list = new List();
return View(list);
//view
@model List
// and property Model is type of List
@foreach(var item in Model)
{
@item.Name
}