title: Set enum values as selected in Razor dropdown
body: <p>I am using a razor view for showing the scored of an  examination and it contains an enum value that holds 3 values "pass","Fail","absent" and i want to choose it accordingly. The model i used is </p>
  
  <h2>    model</h2>
  
  <p>public class VerifyResultModel
      {
          [Display(Name = "StudnetId")]
          public int StudentId { get; set; }</p>
  
  <pre><code>    [Display(Name = "Student")]
      [Required]
      public string Student { get; set; }
  
      [Display(Name = "Mark")]
      [Required]
      public int Mark { get; set; }
  
      [Display(Name = "Score")]
      [Required]
      public string Score { get; set; }
  
      [Display(Name = "Result")]
      public App.EnumValues.ExamResultStatus Result { get; set; }
  
  }  
  </code></pre>
  
  <h2>Controller</h2>
  
  <pre><code>    [HttpGet]
      public ActionResult Verify(int Id)
      {
          List&lt;VerifyResultModel&gt; model_result = new List&lt;VerifyResultModel&gt;();
          VerifyResultModel _resultItem;
          foreach (exammark item in marks)
          {
              SchoolApp.EnumValues.ExamResultStatus result = SchoolApp.EnumValues.ExamResultStatus.Absent;
              if(item.Mark &gt;= MinMark)
              {
                 result= SchoolApp.EnumValues.ExamResultStatus.Pass;
              }
              else
              {
                  result = App.EnumValues.ExamResultStatus.Fail;
              }
              _resultItem = new VerifyResultModel { StudentId = (int)item.StudentId, Student = item.studentmaster.StudentName, Mark = (int)item.Mark, Score = item.Mark.ToString(), Result = result };
              model_result.Add(_resultItem);
          }
           LoadResultsDropdown();
          return View(model_result);
      }
     private void LoadResultsDropdown()
      {
          var types = (from App.EnumValues.ExamResultStatus type in Enum.GetValues(typeof(SchoolApp.EnumValues.ExamResultStatus))
                       select new { Id = type.ToString(), Name = type.ToString() }).ToList();
  
          ViewBag.ResultList = new SelectList(types, "Id", "Name");
      }
  </code></pre>
  
  <h2>View</h2>
  
  <pre><code> @model IList&lt;SchoolApp.ViewModels.VerifyResultModel&gt;  
  &lt;tbody&gt;
   @for (int item = 0; item &lt; Model.Count(); item++)
   {
       &lt;tr&gt;
       &lt;td&gt;          
          @Html.DisplayFor(modelItem =&gt; Model[item].Student)
       &lt;/td&gt;
       &lt;td&gt;
         @Html.DisplayFor(modelItem =&gt; Model[item].Mark)
       &lt;/td&gt;*@
       &lt;td&gt;
         @Html.DisplayFor(modelItem =&gt; Model[item].Score)
       &lt;/td&gt;
       &lt;td&gt;       
          @Html.DropDownListFor(model =&gt; model[item].Result, (SelectList)ViewBag.ResultList) //Here All values are showing as Pass ( first item in dropdown)
       &lt;/td&gt;
       &lt;/tr&gt;
   }
   &lt;/tbody&gt;
  </code></pre>
  
  <p>The problem is even if i pass values Fail / Absent to enum it shows as Pass in combobox . How can i show the correct value ?</p>