title: asp.net MVC3 partial view result not updating EditorFor value
body: <p>I have a simple email capture form as part of my home page, however when I return the partial view the model value for the Editor for form is not getting updated: </p>
  
  <p>The Model</p>
  
  <pre><code>public class Contact 
      {
          [Key]
          public int Id { get; set; }
          [Required]
          public string Email { get; set; }
          [NotMapped]
          public string Message { get; set; }
      }
  </code></pre>
  
  <p>The Views </p>
  
  <pre><code>@model TestApp.Models.Contact
  
  @{
      ViewBag.Title = "Home Page";
  }
  
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.form.js")" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" &gt;
      $(function () {
          // ajax form post 
          $("#EmailForm").ajaxForm(function (result) {
              $("#EmailForm").html(result); // post results 
          });
      });
  &lt;/script&gt;
      @using (@Html.BeginForm("SaveEmail", "Home", FormMethod.Post, new { id = "EmailForm" }))
      { 
          @Html.Partial("SaveEmail", Model);
      }
  </code></pre>
  
  <p>The Partial</p>
  
  <pre><code>@model TestApp.Models.Contact
  
  &lt;span class="editor-label"&gt;
      @Html.LabelFor(m =&gt; m.Email) :
  &lt;/span&gt;
  &lt;span class="editor-field"&gt;
      @Html.EditorFor(m =&gt; m.Email)
  &lt;/span&gt;
  &lt;input type="submit" value="Submit" /&gt;
  &lt;div id="message"&gt; 
      @Html.ValidationMessageFor(m =&gt; m.Email) 
      @Html.DisplayFor(m =&gt; m.Message) 
  &lt;/div&gt;  
  
  &lt;br/&gt;
  </code></pre>
  
  <p>The Controller</p>
  
  <pre><code>  [HttpPost]
          public PartialViewResult SaveEmail(Contact contact)
          {
              if (ModelState.IsValid)
              {
                  //TODO: save e-mail to database
  
                  contact.Message = "You e-mail has been added to our database - Thank y   ou";
                  contact.Email = "";
                      return PartialView(contact);
  
              }
  
              return PartialView();
          }
  </code></pre>
  
  <p>This returns model errors as expected, returns the message when model state is valid, but the email text box value in the response is not updating </p>
  
  <p>The response form firebug when posting e-mail a@b.com</p>
  
  <pre><code>&lt;span class="editor-label"&gt;
      &lt;label for="Email"&gt;Email&lt;/label&gt; :
  &lt;/span&gt;
  &lt;span class="editor-field"&gt;
      &lt;input class="text-box single-line" id="Email" name="Email" type="text" value="a@b.com" /&gt;
  &lt;/span&gt;
  &lt;input type="submit" value="Submit" /&gt;
  &lt;div id="message"&gt; 
  
      You e-mail has been added to our database - Thank you 
  &lt;/div&gt;  
  
  &lt;br/&gt;
  </code></pre>
  
  <p>I've tried creating a new model and passing that in, I've tried ModelState.Clear(), I can fix the problem with a little jquery </p>
  
  <pre><code> $("#Email").val(''); // clear the email address 
  </code></pre>
  
  <p>But this seem a little hacky and I would like to understand what is going on. </p>