title: Asp.net MVC Drop-Down List with Html Helper
body: <p>I'm Completely confused with lots of articles and tutorials about using html helper to generate drop-down list.
  my goal is to have 2 drop-down in the first one I need a list of countries, then after choosing a country next drop-down shows tours available for that country.
  but I'm stuck in the first drop down. </p>
  
  <p>I create a model like this </p>
  
  <pre><code>public class test
  {
      public List&lt;Country&gt; Countries { get; set; }   
  }
  </code></pre>
  
  <p>and in my Controller I have this </p>
  
  <pre><code>   {
          var country = db.Countries.ToList();
          var vn = new test { Countries = country.ToList() };
          return View(vn);
      }
  </code></pre>
  
  <p>and in view <code>foreach</code> loop works correctly and it shows list of countries but my dropdown list has Error and I'm really confused how to fix it.</p>
  
  <pre><code>@model vidiaweb_com.Models.test
  &lt;div class="container" id="ttitle"&gt;
  
  &lt;nav class=""&gt;
      &lt;ul class="resetpadmar"&gt;
          @foreach (var t in Model.Countries)
          {
              &lt;li class=""&gt;
                  &lt;div class="col-md-2 col-sm-2"&gt;
  
                     @t.CountryName
  
                  &lt;/div&gt;
  
  
              &lt;/li&gt;
          }
      &lt;/ul&gt;
  &lt;/nav&gt;
  
  &lt;div class="form-group"&gt;
      @Html.LabelFor(model =&gt; model.Id, "Id", htmlAttributes: new { @class = "control-label col-md-2" })
      &lt;div class="col-md-10"&gt;
          @Html.DropDownList("Id", null, htmlAttributes: new { @class = "form-control" })
          @Html.ValidationMessageFor(model =&gt; model.Id, "", new { @class = "text-danger" })
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>appreciate any help  </p>