title: Selected value for dropdownlistfor in mvc4
body: <p>I have created a ViewBag selectlist in Edit action and set the value to be selected as:</p>
  
  <pre><code>ViewBag.Doors = new SelectList(
      new[]
      {
          new {ID = 1, Name="1-Door"},
          new {ID = 2, Name="2-Doors"},
          new {ID = 3, Name="3-Doors"},
          new {ID = 4, Name="4-Doors"},
          new {ID = 5, Name="5-Doors"},
          new {ID = 6, Name="6-Doors"},
          new {ID = 7, Name="7-Doors"}
      },
      "ID", "Name", advert.Doors);
  </code></pre>
  
  <p>But in the view the value for the dropdown is not selected by default.</p>
  
  <p>My view code is:</p>
  
  <pre><code>@Html.DropDownListFor(model =&gt; model.Doors, (SelectList)ViewBag.Doors, "--Select--")
  @Html.ValidationMessageFor(model =&gt; model.Doors)
  </code></pre>
  
  <p>The property Doors will be numeric 1,2,3,..</p>