title: Pass variable from jquery to code behind
body: <pre><code>&lt;asp:Button ID="Button1" runat="server" Text="Submit" /&gt;
       &lt;script&gt;
          $(document).ready(function () {
             $("#Button1").click(function () {
                  var list = [];
                  var a= $("#TextBox1").val();
                  var b= $("#TextBox2").val();
                  var count = a* b;
                  list.push('test');
                  for (var i = 1; i &lt;= count; i++) {
                     var item = $("#DropDownList_" + i + "_").find(":selected").text();
                     list.splice(i, 0, item);
                     console.log(list.join());
                     alert(list[i]);
                   }              
               });
         });
       &lt;/script&gt;
  </code></pre>
  
  <p>Hello guys first time at the stack! I have this jquery code that get all choices of dropdown list and store it in array.
  I want pass this array to c# so I can store the values in DB, please help.</p>