title: Values which are changed in Jquery, are not showing up on codebehind
body: <ul>
  <li>ASP.NET 4</li>
  <li>Jquery 1.7.1</li>
  <li>Browser: IE9</li>
  </ul>
  
  <p>Hi</p>
  
  <p>I am using jquery with a gridview control inside a UpdatePanel so, everytime I click on a row of the gridview Jquery edits the value of a HiddenField control, so when I need "the selected index", I just use the value of the HiddenField. And everything works fine in Chrome and Firefox, but not in IE9. After clicking a row and assigning it's index to the HiddenField, when I click a button and fire a server side event, when I retrieve the HiddenField's value, I get its default value (the one defined in the mark-up), and not the changed one. And, strangely, if I use and alert(HiddenField.value), it shows me the row index! so, the problem only occurs on the server side function, even after the postback the HiddenField value is preserved, but always as default on server side...</p>
  
  <p>This is my Jquery code:</p>
  
  <pre><code>$('[id$=divtxtIdPresentacion]').click(function () {
  
               var tex = $('#&lt;%=HFSeleccionIndexRow.ClientID%&gt;').attr("Value");
  
               var index = $(this).attr("commandargument");             
  
               if (tex != index) {
  
                   $('#&lt;%=HFSeleccionIndexRow.ClientID%&gt;').attr("Value", index);
               }
  
           });
  </code></pre>
  
  <p>And part of the button event:</p>
  
  <pre><code> protected void gridPresentacionAgregar_SelectedIndexChanged(object sender, EventArgs e)
      {       
  
           int index = int.Parse(HFSeleccionIndexRow.Value);
           ...
       }
  </code></pre>
  
  <p>And the HiddenField (just in case):</p>
  
  <pre><code>&lt;asp:HiddenField runat="server" ID="HFSeleccionIndexRow" value="0" /&gt;
  </code></pre>