public ActionResult PopulateFoods()
{
IEnumerable<Food> foodList = GetAll();
// Renders a partial view, which defines a section of a view that can be rendered inside another view.
return PartialView("_foodTable", foodVms);;
}
Action methods typically return a result that is known as an action result. The ActionResult class is the base class for all action results. The ActionInvoker decide which type of action result to return based on the task that the action method is performing.
It is possible be explicit about what type to return, but generally it not necessary.
public PartialViewResult PopulateFoods()
{
IEnumerable<Food> foodList = GetAll();
// Renders a partial view, which defines a section of a view that can be rendered inside another view.
return PartialView("_foodTable", foodVms);
}