title: Jquery autocomplete on select event
body: <p>I am using jQuery autocomplete and its working fine, now I want to store a variable in session from jQuery when following condition occurs. </p>
  
  <p>When someone types any word jQuery shows suggestion dropdown, if someone select an item from that suggestion dropdown.</p>
  
  <p>I want to capture above point and store a variable in session.</p>
  
  <p>I searched Google, StackOverflow but find no relevant solution. My code for autocomplete is following:</p>
  
  <pre><code>  $(".autosearch-smart").autocomplete('Home/GetCompanyNames', {
      minChars: 1,
      width: 402,
      matchContains: "word",
      autoFill: true
  });
  </code></pre>
  
  <p>and this is what I tried to do:</p>
  
  <pre><code>  $(".autosearch-smart").autocomplete('Home/GetCompanyNames', {
      minChars: 1,
      width: 402,
      matchContains: "word",
      autoFill: true,
      select: function (a, b) {
          alert("selected");
      }
  
  });
  </code></pre>
  
  <p><strong>EDIT : Select event handler is also not working</strong> </p>
  
  <p>I am using asp.net MVC3 with C#. Please help me out and thanks in advance.</p>