title: C# ListItemCollection to JSON, while keeping values and text items
body: <p>I have created a web service (asmx file) that returns a serialized ListItemCollection with the following code.</p>
  
  <pre><code>    public string getStates(string Country)
      {
          ListItemCollection lic = DBInterface.GetStates(Country);
  
          var serialized = JsonConvert.SerializeObject(lic);
  
          return serialized;
      }
  </code></pre>
  
  <p>I call the web service via javascript when a user selects a country from a dropdown list using the following code.</p>
  
  <pre><code>            //ajax function that uses web services to get states
          function GetStates(val)
          {                  
              $.ajax({
                  type: "POST",
                  url: "/WebServices/getServerData.asmx/getStates",
                  data: JSON.stringify({Country: val}),
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  success: function (data) {
                      $("#ddlState").empty();
                      var parsed = JSON.parse(data.d);
                      for (var i = 0; i &lt; parsed.length; i++) {
                          $("#ddlState").append("&lt;option value='" + parsed[i] + "'&gt;" + parsed[i] + "&lt;/option&gt;");
                      }
                  },
                  error: function (data) {
                      alert(data.status + " " + data.statusText);
                  }
              });                    
          }
  </code></pre>
  
  <p>The issue is that I want to also keep not only the ListItemCollection text, but also it's value. However the "JsonConvert.SerializeObject only returns the text items. Can someone help to return the value and text so that I can populate the dropdown via javascript?</p>
  
  <p>Thanks!</p>