title: ASP.NET MVC + Populate dropdownlist
body: <p>In my viewModel I have:</p>
  
  <pre><code>public class PersonViewModel
  {
      public Person Person { get; set; }
      public int SelectRegionId { get; set; }
      public IEnumerable&lt;SelectListItem&gt; Regions { get; set; }
  }
  </code></pre>
  
  <p>But what do I have to do in my Controller/View to show the values? What I have now:<br>
  <strong>Controller:</strong></p>
  
  <pre><code>public ActionResult Create()
  {
       var model = new ReUzze.Models.PersonViewModel
       {
           Person = new Person(),
           Regions = new SelectList(this.UnitOfWork.RegionRepository.Get(), "Id", "Name")
       };
       return View(model);
  }
  </code></pre>
  
  <p><strong>View:</strong></p>
  
  <pre><code> &lt;div class="form-group"&gt;
       @Html.LabelFor(model =&gt; model.Person.Address.Region)
       @Html.DropDownListFor(model =&gt; model.SelectRegionId, new SelectList(Model.Regions, "Id", "Name"), "Choose... ")
   &lt;/div&gt;
  </code></pre>
  
  <p>But it gives an error like this:</p>
  
  <pre><code>Cannot implicitly convert type 'System.Web.Mvc.SelectList' to 'System.Collections.Generic.IEnumerable&lt;System.Web.WebPages.Html.SelectListItem&gt;'. An explicit conversion exists (are you missing a cast?)
  </code></pre>