title: ASP.NET webforms: set cookie using jQuery on the OnSelectedIndexChanged event
body: <p>Consider the scenario where:</p>
  
  <ul>
  <li>an ASP.NET webform page has a DropDownList and a ListView.</li>
  <li>this DropDownList must set a cookie value on its <code>OnSelectedIndexChanged</code> event.</li>
  <li>the DropDownList is also set to <code>AutoPostBack="True"</code> to force the ListView to reload using the DropDownList's new value.</li>
  <li>the page is referencing current JQuery libraries, including the <a href="http://plugins.jquery.com/project/Cookie" rel="nofollow noreferrer">great set of cookie plugins</a></li>
  </ul>
  
  <p>This code will be used in the assignment of the value of the cookie:</p>
  
  <pre><code>var date = new Date();
  date.setTime(date.getTime() + (3 * 24 * 60 * 60 * 1000));
  $.cookie('cookieName', 'theValue', { path: '/', expires: date });
  </code></pre>
  
  <p><strong>Question</strong>: Can you suggest how to have the DropDownList's value extracted and saved to a cookie using jQuery? Super bonus points for an answer including how to call the post-back method to rebind the ListView! I would definitely love to save a post-back 'flash' for the user.</p>