title: Posting MVC Razor form from ajax
body: <p>Within a Partial View, there is a form(@addName) using Html.Helper classes (TextBoxFor, DropDownListFor, etc).  </p>
  
  <pre><code>@model Models.ADP
  
  using (@Html.BeginForm(new { id= @addName}))
  {
      @Html.TextBoxFor(model =&gt; model.EndValue, new { id = @newName, size = "5", style = "margin-right: 10px" })
      @Html.HiddenFor(model =&gt; model.ModuleTypeId, new { @Value = @ViewBag.ModuleId }
      @Html.DropDownListFor(model =&gt; model.DPId, @dpList, "Choose an Option...", new { @class = "select" })
  }
  </code></pre>
  
  <p>I intercept the submit in order to post and retrieve new data asynchronously, divId is the div for the whole Partial View.</p>
  
  <pre><code>    $('#@saveName').click( function (event) {
          event.preventDefault();
          $.ajax({
              url: '@Url.Action("SaveADP", "Dispense")',
              type: 'POST',
              data: $('#@addName').serialize(),
              success: function (data) {
                  $('#@divId').html(data);
              }
          })
      })
  </code></pre>
  
  <p>The SaveADP action is being called, but the only field with a set value is EndValue, the other fields(ModuleTypeId and DPId) have the default values instead of their form values.  What am I doing wrong here?</p>