title: MVC Dynamic Partial View Data Disappearing In IE7
body: <p>I'm having problems with dynamic partial view data disappearing from the textbox after a httppost. Here is my scenario:</p>
  
  <p>The user clicks a radio button, and the coapplicant partial view is loaded dynamically.</p>
  
  <p>Index.aspx (Embedded Javascript):</p>
  
  <pre><code>function showCoApplicant() {
   $.ajax({
    type: "GET",
    url: '&lt;%= Url.Action("LoadCoApplicantInfo","Application") %&gt;',
    data: {},
    dataType: "html",
    async: true,
    success: function (data) {
     $("#CoApplicantInfo").html(data);
    }
   }); }
  </code></pre>
  
  <p>ApplicationController.cs:</p>
  
  <pre><code>public ActionResult LoadCoApplicantInfo() {
   Configurator.Models.CreditApplicationModel model = null;
   if (Session["model"] != null)
    model = (Configurator.Models.CreditApplicationModel)Session["model"];
  
   return PartialView("CoApplicant", model); 
  }
  </code></pre>
  
  <p>CoApplicant.ascx:</p>
  
  <pre><code>&lt;table&gt;
   &lt;tr&gt;
    &lt;th&gt;
     &lt;%= Html.LabelFor(model =&gt; model.CoApplicant.FirstName)%&gt;
    &lt;/th&gt;
    &lt;td&gt;    
     &lt;%= Html.TextBoxFor(model =&gt; model.CoApplicant.FirstName)%&gt;
     &lt;%= Html.ValidationMessageFor(model =&gt; model.CoApplicant.FirstName)%&gt;
    &lt;/td&gt;
   &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The user enters in data, and clicks the submit button. The model is then validated in the controller. If the ModelState is invalid, I return the view along with the model in session (I do this because I need to return that model to the partial view. This was the only way I could get the data back to it.). On httppost, in Javascript, I determine if the coapplicant partial view should be showing, and if so, I load it again by calling showCoApplicant().</p>
  
  <pre><code>[HttpPost]
   public ActionResult Index(Configurator.Models.CreditApplicationModel model)
   {
   if (!ModelState.IsValid)
   {
    Session["model"] = model;
          return View();
   }
   }
  </code></pre>
  
  <p>This is where I have the problem. The data for the coapplicant is missing in IE7. It works fine in other versions of IE, Chrome, and Firefox. Why is the data missing in IE7? How can I get it to show?</p>