title: javascript function is called before dropdown value is set
body: <p>I have a dropdown list in a gridview template field and passing the rowIndex to a javascript function.  It seems like the javascript function is fired before the value on the dropdown has time to fully change to the selected value.  Consequently I'm always getting the first index returned even though I selected otherwise from the dropdown...</p>
  
  <pre><code> &lt;asp:TemplateField HeaderText="Establishment"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:DropDownList ID="drpUserEstablishment" CssClass="dropdown" ClientIDMode="Static"
                                  runat="server" AutoPostBack="false"
                                  onchange='&lt;%#"setUserEstablishment(" + Container.DataItemIndex +")"%&gt;'&gt;
                              &lt;/asp:DropDownList&gt;
  
                         &lt;/ItemTemplate&gt;
  
    &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>Javascript function:</p>
  
  <pre><code>function setUserEstablishment(rowIndex) {
       var establishid = $('#drpUserEstablishment option:selected').val();
  }
  </code></pre>