title: MVC @Html.DropDownList Getting Error with SelectList in ViewBag
body: <p>I have a list which I created in the controller:</p>
  
  <pre><code>     var PayList = new[] {
        new ListEntry { Id = 1, Name = "" },
        new ListEntry { Id = 2, Name = "Yes" },  
        new ListEntry { Id = 3, Name = "No" }  
  
        };
  
       ViewBag.PayList = new SelectList(PayList, "Id", "Name");
  </code></pre>
  
  <p>In the view I have the following:</p>
  
  <pre><code>    @Html.DropDownList("Pay", new SelectList(ViewBag.PayList,"Id","Name")) 
  </code></pre>
  
  <p>When I try to display it, it says the following:
  DataBinding: 'System.Web.Mvc.SelectListItem' does not contain a property with the name 'Id'. Not sure why this is not working. </p>
  
  <p>Also how do I default a value to the select list. I like to default it to "Yes". I thought there was a way to do do this from the controller.</p>