title: Pass unordered List selected item to ASP.NET Web Forms using jQuery
body: <p>I asked a question earlier but didn't phrase it correctly. </p>
  
  <p>I am working with jQuery and Bootstrap for pretty much the first time and need some help. </p>
  
  <p>I have an <code>.aspx</code> webpage that has this code:</p>
  
  <pre><code>&lt;form method="POST" action="Search.aspx"&gt;
      &lt;div&gt;
          &lt;input type="text" class="form-control" name="srchterm" id="srchterm" style="width: 300px" /&gt;
          &lt;button id="Submit" class="btn btn-primary" type="submit"&gt;
              GO!&lt;/button&gt;
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;div&gt;
          &lt;div class="btn-group"&gt;
              &lt;a id="reportType" class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="#"
                   name="rptType"&gt;Select report type&lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
              &lt;ul class="dropdown-menu"&gt;
                  &lt;li id="1"&gt;&lt;a href="#"&gt;All&lt;/a&gt;&lt;/li&gt;
                  &lt;li id="2"&gt;&lt;a href="#"&gt;Some&lt;/a&gt;&lt;/li&gt;
                  &lt;li id="3"&gt;&lt;a href="#"&gt;None&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
          &lt;div class="btn-group"&gt;
              &lt;a id="reportStatus" class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="#"&gt;
                  Report Status&lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
              &lt;ul class="dropdown-menu"&gt;
                  &lt;li id="1"&gt;&lt;a href="#"&gt;Active&lt;/a&gt;&lt;/li&gt;
                  &lt;li id="2"&gt;&lt;a href="#"&gt;Archived&lt;/a&gt;&lt;/li&gt;
                  &lt;li id="3"&gt;&lt;a href="#"&gt;All&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;/form&gt;
  </code></pre>
  
  <p>What I would like to know is how I can pass the value of the selected unordered list item to the code behind using JQuery or AJAX. Neither method I know much (or to be totally honest) anything about. </p>
  
  <p>When I hit the submit button it takes the text box value and passes that back to <code>Request.Form("srchTerm")</code> but i cant seem to get anything else to pass. </p>
  
  <p>I have seen this link here at <a href="http://jsfiddle.net/RyG95/1/" rel="nofollow">fiddle</a> but cant seem to get it to work for me. </p>
  
  <p>I am wondering if its because how I have declared my listbox, but do need help in order to get this to work. </p>
  
  <p>If I am missing a tag, please let me know. But I would very much appreciate the help with the JavaScript to get this wired up to pass the data so I can call the information from my database. </p>
  
  <p>====================================</p>
  
  <h1>edit 1</h1>
  
  <p>I've tried various methods, none of which i have kept, but this is that i have right now and cant get anything to pass a value across.</p>
  
  <pre><code>$(".dropdown-menu li a").click(function () {
      var selText = $(this).text();
      $(this).parents('.btn-group').find('.dropdown-toggle').html(selText + '     &lt;span class="caret"&gt;&lt;/span&gt;');
  });
  
  $('.reportType li').click(function () {
      value1 = $(this).attr('value');
  });
  
  $('.reportStatus li').click(function () {
      value2 = $(this).attr('value');
  });
  
  $('#Submit').click(function () {
      alert('value1 = ' + value1 + ' | value2 = ' + value2);
  });
  </code></pre>