title: Passing an array of values in an ASP.NET jQuery AJAX POST
body: <p>I have a ListBox on my page, and I'd like to make an AJAX post containing all the selected items. Here's my code:</p>
  
  <pre><code>$('#btnSubmit').click(function() {
      $.ajax({
          type: "POST",
          url: 'Default.aspx/GetSelectedValues',
          data: '{selectedValues: }',
          contentType: "application/json; charset=utf-8",
          dataType: "json",
          success: OnSuccess
      });
  });
  
  &lt;select id="lbItems" multiple="multiple"&gt;
      &lt;option value="1"&gt;One&lt;/option&gt;
      &lt;option value="2"&gt;Two&lt;/option&gt;
      &lt;option value="3"&gt;Three&lt;/option&gt;
      &lt;option value="4"&gt;Four&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I'd like to pass in the selected values either as an array, or a comma-delimited string. What's the best way to pass that data, and how can I do it?</p>