title: How can I refresh just a Partial View in its View?
body: <p>What Am I doing wrong guys? This is the idea...</p>
  
  <p>Index view</p>
  
  <pre><code>&lt;div class="col-lg-12 col-md-12 col-xs-12"&gt;
      @Html.Partial("PartialView", Model)
  &lt;/div&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>public ActionResult PartialView()
  {
      return PartialView("PartialView");
  }
  
  [HttpPost, ValidateInput(false)]
  public ActionResult POSTPartialView(string param1)
  {
      return PartialView("PartialView");
  }   
  </code></pre>
  
  <p>PartialView has a Form.
  The first time I enter in Index, PartialView works, but the second time, after a POST call (coming from the form inside of PartialView), I only got to render the PartialView out of the Index.</p>
  
  <p>So to fix it, I´m doing the next:</p>
  
  <pre><code>[HttpPost, ValidateInput(false)]
  public ActionResult POSTPartialView(string param1)
  {
      return View("Index");
  }   
  </code></pre>
  
  <p>That works. I render all Index again (with my changes, after POST). But I refresh all page so I lost a few CSS Elements (accordion discollapsed for example).</p>
  
  <p>Should I use Ajax for refreshing only the div which contents PartialView?</p>
  
  <p>Thanks Mates.</p>
  
  <p>EDITED:</p>
  
  <pre><code>@using (Html.BeginForm("PartialView", "Controller", FormMethod.Post, new { @class = "form-inline", role = "form" }))
  {
      &lt;div class="form-group col-lg-3 col-md-3 col-xs-3"&gt;
          &lt;label for="DATA"&gt;DATA:&lt;/label&gt;
          &lt;input type="text" class="form-control pull-right" name="DATA"&gt;
      &lt;/div&gt; 
      &lt;button type="submit" class="btn btn-primary pull-right"&gt;Get Data&lt;/button&gt;
  }
  </code></pre>