title: Which object I can pass into JSON in asp.net?
body: <p>I have created to list box. Left listbox contains List Items and the right list box nothing have at server side.</p>
  
  <pre><code>&lt;div class="row" style="padding-top:10px;"&gt;
      &lt;div class="col-lg-3"&gt;
          &lt;asp:ListBox ID="lstLeft" class="form-control" runat="server" SelectionMode="Multiple" Height="220px"&gt;
          &lt;asp:ListItem Value="transactions.storeid as StoreID"&gt;StoreID&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="YEAR(transactions.Time) Year"&gt;Year&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="MONTH(transactions.Time) Month"&gt;Month&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="transactionsEntry.TransactionNumber"&gt;TransactionNumber&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="transactionsEntry.Quantity"&gt;Quantity&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="items.ItemLookupCode"&gt;ItemLookupCode&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="CONVERT(varchar, CAST(transactionsEntry.Price AS money), 1)*transactionsEntry.Quantity ExtendedPrice"&gt;ExtendedPrice&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="departments.Name as DepartmentName"&gt;DepartmentName&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="categories.Name as CategoryName"&gt;CategoryName&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="items.SubDescription1"&gt;SubDescription1&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="suppliers.SupplierName"&gt;SupplierName&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="suppliers.Code"&gt;Code&lt;/asp:ListItem&gt;
          &lt;/asp:ListBox&gt;
      &lt;/div&gt;
      &lt;div class="col-lg-1"&gt;
          &lt;input type="button" id="left" value="&lt;&lt;" /&gt;
          &lt;input type="button" id="right" value="&gt;&gt;" /&gt;
      &lt;/div&gt;
          &lt;div class="col-lg-3"&gt;
          &lt;asp:ListBox ID="lstRight" runat="server" SelectionMode="Multiple" Width="100%" Height="220"&gt;&lt;/asp:ListBox&gt;
      &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>At runtime I am moving a list items from left list box to right list box by clicking button through Jquery.</p>
  
  <pre><code>$(function () {
  
              $("#left").bind("click", function () {
                  var options = $("[id*=lstRight] option:selected");
                  for (var i = 0; i &lt; options.length; i++) {
                      var opt = $(options[i]).clone();
                      $(options[i]).remove();
                      $("[id*=lstLeft]").append(opt);
                  }
              });
              $("#right").bind("click", function () {
                  var options = $("[id*=lstLeft] option:selected");
  
                  for (var i = 0; i &lt; options.length; i++) {
                      var opt = $(options[i]).clone();
  
                      $(options[i]).remove();
                      $("[id*=lstRight]").append(opt);
                  }
  
              });
  </code></pre>
  
  <p>Now I want to add listbox items which is moved in Right ListBox using JSON. 
  So I want to make one map variable in jquery and pass that variable on JSON and then Add those values in Right listbox at server side.</p>
  
  <p>Here what i tried to get all text and values and put it in one variable. But i Don't understand how it's working and which variable i should pass in json.</p>
  
  <pre><code>var options = $('#lstRight option');
  var values = $.map(options, function (option) {
      alert("Text = " + option.text + " Value = " + option.value);
      //alert("Values =" + values);
  });
  </code></pre>
  
  <blockquote>
    <p>When I try this one <code>alert("Values =" + values);</code> I am getting undefined. So which variable I should pass in JSON</p>
  </blockquote>
  
  <p>thanks</p>