title: asp.net MVC3 JQuery hidden field not being posted
body: <p>note that the code works fine on my machine but when published to my hosting provider the hidden data is not being posted</p>
  
  <p>I have a form where you set the address, google maps then gets the lat/lng and jquery will set the value in the hidden field</p>
  
  <p>but when posted the value are not sent to the server</p>
  
  <p>I even tried Request["Lat"] and nothing is sent</p>
  
  <p>When running the same code on my local machine it works fine, could it be a configuration problem? I don't see it.</p>
  
  <p>Thanks</p>
  
  <p>here is part of the code
  webpage</p>
  
  <pre><code>...
  @using (Html.BeginForm("Register","Account")) // same error without the action and controller specified
  
  ....
   @Html.TextBoxFor(m =&gt; m.Address, new { maxlength = "200" })
  .....
  @Html.HiddenFor(m =&gt; m.Lat)
  @Html.HiddenFor(m =&gt; m.Lng)
  ....
  </code></pre>
  
  <p>in js </p>
  
  <pre><code>...
  $('#Address').blur(function () {
          $('#Address').val($('#Address').val().toUpperCase());
          codeAddress();
          drawCircle();
      });
  ...
  function codeAddress() {
      if ($('#Address').val() == '')
          return;
  
      var address = $('#Address').val() + ', CA';
      if (geocoder) {
          geocoder.geocode({ 'address': address }, function (results, status) {
              if (status == google.maps.GeocoderStatus.OK) {
                  $('#Lat').val(results[0].geometry.location.lat());
                  $('#Lng').val(results[0].geometry.location.lng());
                  //alert($('#Lat').val() + ', ' +$('#Lng').val())
                  map.setCenter(results[0].geometry.location);
                  drawCircle();
              } else {
                  alert("Geocode was not successful for the following reason: " + status);
              }
          });
      }
  }
  ....
  </code></pre>
  
  <p>at this point the alert shows the new lat,lng</p>
  
  <p>when posted the default 0 of empty is posted</p>
  
  <p>My question is why would it always work on my dev machine and not on my shared hosting?</p>
  
  <p>UPDATE : it seems like the defaultbinder is not binding, why would it work locally but not on live server?</p>
  
  <p>New Update:
  Actually the form is being posted I can see in firebug
  My controller says that no form data was received though
  my log indicates no post data</p>
  
  <p>it happens also on the log on, where only username, password and remember me are sent 
  any idea would help </p>
  
  <pre><code>@Html.ValidationSummary(true, @sResources.Strings.LogOnUnsuccessful)
  @using (Html.BeginForm("LogOn", "Account"))
  {
      &lt;div&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;Account Information&lt;/legend&gt;
              &lt;div class="editor-label"&gt;
                  @Html.LabelFor(m =&gt; m.UserName)
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  @Html.TextBoxFor(m =&gt; m.UserName, new { style = " width:200px" })
                  @Html.ValidationMessageFor(m =&gt; m.UserName)
              &lt;/div&gt;
              &lt;div class="editor-label"&gt;
                  @Html.LabelFor(m =&gt; m.Password)
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  @Html.PasswordFor(m =&gt; m.Password, new { style = " width:200px" })
                  @Html.ValidationMessageFor(m =&gt; m.Password)
              &lt;/div&gt;
              &lt;div class="editor-label"&gt;
                  @Html.CheckBoxFor(m =&gt; m.RememberMe)
                  @Html.LabelFor(m =&gt; m.RememberMe)
              &lt;/div&gt;
              &lt;p&gt;
                  &lt;input type="submit" value="@sResources.Strings.LogOn" /&gt;
              &lt;/p&gt;
          &lt;/fieldset&gt;
      &lt;/div&gt;
  }
  
  
         [HttpGet]
              public ActionResult LogOn()
              {
                  return View();
              }
  
              [HttpPost]
              public ActionResult LogOn(LogOnModel model, string returnUrl)
              {
                  //LogOnModel model = new LogOnModel() { UserName = UserName, Password = Password, RememberMe = RememberMe.HasValue ? RememberMe.Value : false };
                  if (model != null)
                      Log(new Exception(string.Format("model username : {0}, password : {1}, request[username] {2} , request[password] : {3}", model.UserName, model.Password, Request["UserName"], Request["Password"])));
                  try...
  </code></pre>
  
  <p>where model.UserName and model.Password is empty</p>
  
  <p>why is the model empty</p>