title: getJSON to populate dropdown list MVC4
body: <p>I have the following controller action:</p>
  
  <pre><code>[HttpPost]
      public ActionResult GetCourseSections(int courseID)
      {  
           var Sections = dbcontext.CourseSection.Where(cs =&gt; cs.CourseID.Equals(courseID)).Select(x =&gt; new
          {
              sectionID = x.CourseSectionID,
              sectionTitle = x.Title
          });
          return Json(Sections, JsonRequestBehavior.AllowGet);
      }
  </code></pre>
  
  <p>This returns the list that I am expecting. I then try to retrieve this list to populate a dropdown using the following code:</p>
  
  <pre><code>$.getJSON('@Url.Action("GetCourseSections", "Admin")',
              function(data) {
                  var courseSectionDropdown = $('#coursesectiondd');
                  courseSectionDropdown.empty();
                  courseSectionDropdown.append($('&lt;option/&gt;', {
                      value: 0,
                      text: "Test"
                  }));
                  $.each(data, function (index, data) {
                      courseSectionDropdown.append($('&lt;option/&gt;', {
                          value: data.value,
                          text: data.text
                      }));
                  });
              });
  </code></pre>
  
  <p>Although on debug I am able to see the list of JSON objects when adding them the only list item being added is the default option "Test" that I am setting. Can anyone see from my code why the data is not being read? Have I made a mistake in the jquery</p>