title: Read files from database and put it into my Combo box over HTML page
body: <p>I try to add my files into <code>DropDownList</code>, all my files with the relevant property already return by the controller:</p>
  
  <pre><code>// GET: /WebMail/
  public ActionResult Index()
  {
      var fileNameList = db.Captures.ToList().Where(x =&gt; x.robotFamily == "WebMail");
      //return View(db.Captures.ToList().Where(x =&gt; x.robotFamily == "WebMail"));
      ViewBag.Files = fileNameList;
      return View();
  }
  </code></pre>
  
  <p>Index.cshtml</p>
  
  <pre><code>@model IEnumerable&lt;AutomationCapturesMVC.Models.Capture&gt;
  
  @{
      //ViewBag.Title = "Index";
  }
  
  &lt;table class="table"&gt;
      &lt;tr&gt;
          &lt;th style="font-size: 20px"&gt;
              @Html.DisplayNameFor(model =&gt; model.fileName) 
          &lt;/th&gt;
          &lt;th&gt;&lt;/th&gt;
      &lt;/tr&gt;
          @Html.DropDownList("Id", (IEnumerable&lt;AutomationCapturesMVC.Models.Capture&gt;)ViewBag.Files, new { id = "WebMail", @class = "btn dropdown-toggle" })
  
      @foreach (var item in Model)
      {
          &lt;tr&gt;
              &lt;td style="font-size: 15px"&gt;
                  @Html.DisplayFor(modelItem =&gt; item.fileName)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.ActionLink("File Details", "Details", new { id = item.id })
              &lt;/td&gt;
          &lt;/tr&gt;
      }
  
  &lt;/table&gt;
  </code></pre>
  
  <p>this is my page error:</p>
  
  <p><a href="http://s21.postimg.org/983eokpfq/1231231313.jpg" rel="nofollow">http://s21.postimg.org/983eokpfq/1231231313.jpg</a></p>