I have started to create my first and small MVC4 website. On the home page I would like to have several asp:GridView controls. In the HomeController / ActionIndex method I managed to collect the data (List of objects) that I'm passing to its View through ViewData. Now I stucked here. How can I use these list of objects as the DataSource of the GridView controls?
public ActionResult Index()
{
JenkinsClient client = new JenkinsClient("http://localhost:8080");
bool isJenkinsOnline = client.IsJenkinsOnline();
if (isJenkinsOnline)
{
var jobs = client.GetJobs();
var builds = client.GetBuilds();
ViewData["Jobs"] = jobs;
ViewData["Builds"] = builds;
}
return View();
}
Should I use another approach? I prefer ASPX than Razor.