@model IEnumerable<irasoftwares.models.person> @{ ViewBag.Title = "Home Page"; WebGrid grid = new WebGrid(); }
<h2>List Of Person</h2> @grid.GetHtml(columns:new[]{ grid.Column("ID"), grid.Column("Name"), grid.Column("Last Name") })
namespace IRASoftwares.Models { public class Person { public int id { get; set; } public string Name { get; set; } public string Surname { get; set; } } }
public ActionResult Index() { Person loperson = new Person(); List<person> lapeaople = new List<person>(); loperson.id = 101; loperson.Name = "Lakhan"; loperson.Surname = "Aanjana"; lapeaople.Add(loperson); loperson = new Person(); loperson.id = 102; loperson.Name = "Manish"; loperson.Surname = "Aanjana"; lapeaople.Add(loperson); loperson = new Person(); loperson.id = 103; loperson.Name = "Mahesh"; loperson.Surname = "Patel"; lapeaople.Add(loperson); loperson = new Person(); loperson.id = 104; loperson.Name = "Nittile"; loperson.Surname = "Gupta"; lapeaople.Add(loperson); loperson = new Person(); loperson.id = 105; loperson.Name = "Harish"; loperson.Surname = "Verma"; lapeaople.Add(loperson); loperson = new Person(); loperson.id = 106; loperson.Name = "Lokesh"; loperson.Surname = "Mor"; lapeaople.Add(loperson); var data = lapeaople; return View(data ); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)