title: Get updated HiddenField Value in code behind
body: <p>I have a LinkButton in aspx page where on OnClientClick I am updating the value of Hidden Field, and on  OnClick I am saving that value to the database.</p>
  
  <pre><code>&lt;asp:LinkButton runat="server" ID="lnkUpdateGeocode" Text="Update Geocode"
  OnClientClick="updateGeoCode()" OnClick="lnkUpdateGeocode_Click" /&gt;
  </code></pre>
  
  <p>where my <strong>updateGeoCode()</strong> function is </p>
  
  <pre><code>function updateGeoCode() {
          var address = document.getElementById('lblDisplayAddress');
          var geocoder = new google.maps.Geocoder();
          geocoder.geocode({ 'address': address }, function (results, status) {
              if (status == google.maps.GeocoderStatus.OK) {
                  var latitude = results[0].geometry.location.lat();
                  var longitude = results[0].geometry.location.lng();
                  longitudeField = $get('&lt;%=Longitude.ClientID %&gt;');
                  latitudeField = $get('&lt;%=Latitude.ClientID %&gt;');
  
                  longitudeField.value = longitude;
                  latitudeField.value = latitude;
              } else {
                  alert('Geocode was not successful');
              }
          });
      };
  </code></pre>
  
  <p>and my <strong>lnkUpdateGeocode_Click()</strong> is </p>
  
  <pre><code>latitude = Latitude.Value.IsBlankOrNull() ? 0M : Convert.ToDecimal(Latitude.Value);
  longitude = Longitude.Value.IsBlankOrNull() ? 0M : Convert.ToDecimal(Longitude.Value);
  </code></pre>
  
  <p>But I am always getting latitude and longitude values as 0. </p>
  
  <p>So <strong>My Question</strong> is how to get the updated value of HiddenField in CodeBehind when I am changing that in javascript. Any help would be appreciated.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>My HiddenField Value is set as runat="server"</p>
  
  <pre><code>&lt;asp:HiddenField ID="Longitude" runat="server" EnableViewState="false" /&gt;
  &lt;asp:HiddenField ID="Latitude" runat="server" EnableViewState="false" /&gt;
  </code></pre>
  
  <p>I tried <code>Request.Form[Latitude.UniqueID]</code> but it is also giving Blank string.</p>
  
  <p><img src="https://i.stack.imgur.com/JEg9q.jpg" alt="enter image description here"></p>