title: What am i doing wrong with asp.net-mvc dropdownlist?
body: <p>I use a dropdownlist in one of my create.aspx but it some how doesnt seem to work...</p>
  
  <pre><code>public IEnumerable&lt;SelectListItem&gt; FindAllMeasurements()
      {
          var mesurements = from mt in db.MeasurementTypes
                            select new SelectListItem
                            {
                               Value = mt.Id.ToString(),
                               Text= mt.Name
                            };
          return mesurements;
      }
  </code></pre>
  
  <p>and my controller,</p>
  
  <pre><code> public ActionResult Create()
      {
        var mesurementTypes = consRepository.FindAllMeasurements().AsEnumerable();
       ViewData["MeasurementType"] = new SelectList(mesurementTypes,"Id","Name");
       return View();
      } 
  </code></pre>
  
  <p>and my create.aspx has this,</p>
  
  <pre><code>&lt;p&gt;
    &lt;label for="MeasurementTypeId"&gt;MeasurementType:&lt;/label&gt;
      &lt;%= Html.DropDownList("MeasurementType")%&gt;
       &lt;%= Html.ValidationMessage("MeasurementTypeId", "*") %&gt;
     &lt;/p&gt;
  </code></pre>
  
  <p>When i execute this i got these errors,</p>
  
  <pre><code>DataBinding: 'System.Web.Mvc.SelectListItem' does not contain a 
   property with the name 'Id'.
  </code></pre>