title: In ASP.NET MVC, how does a controller know which view to call?
body: <p>This may sound like a dumb question, I'm a fairly experienced programmer but I'm brand new to .NET and MVC.</p>
  
  <p>In a class I was taking, we have a controller class (Homecontroller.cs) I understand that calling Return View() in the ActionResult Index() method will cause .NET to look for a "Home" view with the file Index.cshtml. However, in this example, we have return View(cars) where car is an instance of type Car. So the code does go back to Views/Home/index.html even though there is no "cars" view. But that class is a model of type Car. So if you have a type of object returned in "return View", does ASP.NET search the .chstml files looking for that model type? Or is it still just looking for Home/Index.html because return View is being called from the index method. In brief, how does ASP.NET know, in the code below, to go to Views/Home/Index.cshtml? I'll paste the relevant code below:</p>
  
  <p>Controllers/HomeController.cs:</p>
  
  <pre><code>public class HomeController : Controller
  {
      // GET: Home
      public ActionResult Index()
      {
          var cars = HelloMVC.Models.HelloModel.GetCars();
  
          return View(cars);
      }
  }
  </code></pre>
  
  <p>Views/Home/Index.cshtml:</p>
  
  <pre><code>@model List&lt;HelloMVC.Models.HelloModel.Car&gt;
  @{
      ViewBag.Title = "Index";
  }
  
  @foreach (var car in Model)
  {
      &lt;p&gt;@car.ID - @car.Make - @car.Model&lt;/p&gt;
  }
  </code></pre>