Returning a list to strongly typed view using viewbag
问题 I am trying to return a list of customers to a strongly typed view using the viewbag and am having some difficulties as im new to MVC and Razor, can anyone kindly offer any advice on the following problem please? I have the following Code in my controller, public ViewResult Index() { var q = from a in db.Customers select a; ViewBag.customer = q; return View(db.CustomerSites.ToList()); } and this code in my view @foreach (var customer in Model) { <tr> <td> @ViewBag.customer.CustomerName <td>