title: Set the selected item in dropdownlist in MVC3
body: <p>I have to set the selected item for a dropdownlist in view. But its not working.</p>
  
  <p>//View </p>
  
  <pre><code>&lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Gender)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
             @Html.DropDownListFor(model =&gt; model.Gender,Model.GenderList)
          &lt;/div&gt;
  </code></pre>
  
  <p>//Model </p>
  
  <pre><code>[Required(ErrorMessage = "Please select gender!")]
          [Display(Name = "Gender")]
          public string Gender { get; set; }
  
    public IEnumerable&lt;SelectListItem&gt; GenderList
          {
              get
              {
                  return new[]
              {
                  new SelectListItem { Value = "0", Text = "Select" },
                  new SelectListItem { Value = "1", Text = "Male" },
                  new SelectListItem { Value = "2", Text = "Female" },
              };
              }
          }
  </code></pre>
  
  <p>The gender property has the value needs to be selected in the list. Still not working.</p>
  
  <p>Where i'm wrong?</p>