title: HttpPost to MVC partial view?
body: <p>Allow me to preface this by saying that I did look into other SO questions dealing with this matter, but they were either ASP solutions or not quite exactly what I needed. </p>
  
  <p>My question is as follows, can I make an Http Post request to a method in my controller that returns a partial view if I am using <code>Html.BeginForm</code>? I know, and have used, POST methods using BeginForm multiple times, however, those were to ActionResult methods which were responsible for transferring the data stored over into the server. What I would like to do is something as follows: </p>
  
  <p>Say I have this cshtml: </p>
  
  <pre><code>&lt;div class="test"&gt;
  @using (Html.BeginForm("MyPartialViewMethod"), FormMethod.POST) {
      @Html.LabelFor(x =&gt; x.StartTimeLabel, Model.StartTime);
      @Html.TextBoxFor(x =&gt; x.StartTime);
  
     &lt;input type="button" value="Submit"/&gt;
  }
  
  &lt;/div&gt;
  </code></pre>
  
  <p>Such that in my Controller I could say have the following example method. </p>
  
  <pre><code>[HttpPost]
  public PartialViewResult MyPartialViewMethod(Model DynamicDataModel) {
       //Pass the data in the DynamicDataModel into a  new cshtml page and
       //have the partial view it returns be rendered on screen
  }
  </code></pre>
  
  <p>So in a nutshell: </p>
  
  <ol>
  <li>Make POST request to server passing into it my data values</li>
  <li>Have server process the data and return the partial view accordingly populated with all the required data. </li>
  </ol>
  
  <p>I imagine that I could take the approach I used to do back in college with php which is AJAX call via JS to php, php spits out html, JS adds the html where it is needed. However, this seems to be a bit too rough. </p>