title: Looping through a list inside a HTML.DropDownList C# MVC
body: <p>I have been trying to loop through a list inside of a drop down list but it doesn't seem to be working. Here's the code.</p>
  
  <pre><code>public class AnimalHandler
  {
      public List&lt;string&gt; DogBreeds = new List&lt;string&gt;()
      {
         "Affenpinscher","Lhasa Apso","Shitzu", "Tibetan Terrier"
      }
  }
  </code></pre>
  
  <p>And then in the view </p>
  
  <pre><code>Project1.Models.AnimalHandler animal = new Project1.Models.AnimalHandler();
  
  @Html.DropDownList("breed", new List&lt;SelectListItem&gt; { 
      foreach(var item in animal.DogBreeds)
      {
            new SelectListItem {Text="item", Value=""},
      }
      new SelectListItem {Text="Choose a Breed", Value=""}
  })
  </code></pre>
  
  <p>My thought behind it would be that var item would loop through all the items in the DogBreeds however there seems to be an error and I can't figure out what it could be.</p>
  
  <p>Perhaps there is another <strong>SIMPLE</strong> way of doing this? Thanks</p>