title: Jquery populate drop down list in mvc
body: <p>I am trying to populate a drop down list an I am still very confused about J query as I am very new to it.</p>
  
  <p>this is my code:</p>
  
  <p>in the controller: </p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
      public ActionResult GetTeams(StatisticModel model)
      {
          StatisticModel newModel = new StatisticModel(model.leagueId);
          var teams = newModel.getTeams;
          return Json(teams);
      }
  </code></pre>
  
  <p>in view:</p>
  
  <pre><code>&lt;%: Html.DropDownListFor(model =&gt; model.teamIdHome, Model.getTeams, new { @class = "dropdownlistStyle" })%&gt;
  </code></pre>
  
  <p>the jquery:</p>
  
  <pre><code>$(function() {
  $(".dropdownlistStyle").change(function () {
      $.getJSON("/Admin/GetTeams", { FooId: $(".dropdownlistStyle").val() },
         function(fooList) {
             $("#NameList").empty();
             $.each(fooList, function(i, foo) {
                 $("#NameList").append(""+ foo.Name + "");
             });
         });
     });
  </code></pre>
  
  <p>});</p>
  
  <p>At the moment when clicking on the Get Teams button this is the result:</p>
  
  <blockquote>
    <p>[{"Selected":false,"Text":"Arsenal","Value":"1"},{"Selected":false,"Text":"Aston
    Villa","Value":"3"},{"Selected":false,"Text":"Cardiff
    City","Value":"20"},{"Selected":false,"Text":"Chelsea","Value":"4"},{"Selected":false,"Text":"Crystal
    Palace","Value":"22"},{"Selected":false,"Text":"Everton","Value":"5"},{"Selected":false,"Text":"Fulham","Value":"6"},{"Selected":false,"Text":"Hull
    City","Value":"21"},{"Selected":false,"Text":"Liverpool","Value":"7"},{"Selected":false,"Text":"Manchester
    City","Value":"8"},{"Selected":false,"Text":"Manchester
    United","Value":"9"},{"Selected":false,"Text":"Newcastle
    United","Value":"10"},{"Selected":false,"Text":"Norwich","Value":"11"},{"Selected":false,"Text":"Southampton","Value":"13"},{"Selected":false,"Text":"Stoke
    City","Value":"14"},{"Selected":false,"Text":"Sunderland","Value":"15"},{"Selected":false,"Text":"Swansea
    City","Value":"16"},{"Selected":false,"Text":"Tottenham
    Hotspur","Value":"17"},{"Selected":false,"Text":"West Bromwich
    Albion","Value":"18"},{"Selected":false,"Text":"West Ham
    United","Value":"19"}]</p>
  </blockquote>
  
  <p>I am sure that my jquery is incorrect as I got that from a sample from a forum.</p>
  
  <p>Any help please?</p>