title: POST from partial view is hitting controller twice
body: <p>I have a form in a view (Edit view), and a partial view inside that form on the Edit view.  The partial view has its own form which performs a lookup. The lookup in the partial view is successfully returning the results to the Edit view. However, the POST from the partial view is then hitting the controller a second time (trying to submit the form in the Edit view).  How do I stop the POST from hitting the controller a second time?</p>
  
  <p>Here is where the partial view is called in the Edit view:</p>
  
  <pre><code>&lt;div class="form-group" id="search-pac"&gt;
      @Html.Action("PacSearch", "ItemRequest");
  &lt;/div&gt;
  &lt;div class="form-group" id="search-pac-results"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is where the controller gets the partial view:</p>
  
  <pre><code>[HttpGet]
  public ActionResult PacSearch()
  {
      return PartialView("_PacSearchFormPartial");
  }
  </code></pre>
  
  <p>Here is the form in the partial view:</p>
  
  <pre><code>@using (Ajax.BeginForm("PacSearch", "ItemRequest", FormMethod.Post,
      new AjaxOptions
      {
          InsertionMode = InsertionMode.Replace,
          HttpMethod = "POST",
          UpdateTargetId = "search-pac-results"
      }))
  {
      &lt;div&gt;
          @Html.TextBox("pacupc")
          &lt;input type="submit" value="Find PAC" /&gt;
      &lt;/div&gt;      
  }
  </code></pre>
  
  <p>Which then hits the controller here:</p>
  
  <pre><code>[HttpPost]
  public ActionResult PacSearch(string pacupc)
  {  
      //do lookup stuff, and call a partial view to display the results
  }
  </code></pre>
  
  <p>Once the results are displayed on the Edit view, POST then hits the controller here (which I don't want unless the submit button in the Edit view is clicked):</p>
  
  <pre><code>[HttpPost]
  public ActionResult Edit(ItemRequest itemRequest, HttpPostedFileBase upcImage, Comment comment, String FinalApproval)
  {  
      //handle form submission from Edit View
  }
  </code></pre>
  
  <p>How do I keep the POST from the partial view from hitting the HttpPost for Edit view in the controller?</p>
  
  <p><strong>UPDATE:</strong>
  Upon the suggestion to use a direct AJAX call, I ditched the partial views and changed my Edit view to:</p>
  
  <pre><code>                            &lt;div class="form-group" id="search-pac"&gt;
                                  @Html.TextBox("pacupc")
                                  &lt;input type="button" id="btn-pacupc" value="Find PAC" /&gt;
                                @*  @Html.Action("PacSearch", "ItemRequest");*@
                              &lt;/div&gt;
                              &lt;div class="form-group" id="search-pac-results"&gt;
                              &lt;/div&gt;
  </code></pre>
  
  <p>And AJAX call:</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              $(document).on('click', '#btn-pacupc', function () {
                  var pacupc = $("#pacupc").val();
                  $.ajax({
                      type: "POST",
                      url: "@Url.Action("PacSearch")",
                      data: { pacupc: pacupc },
                      success: function (result) { $('#search-pac-results').html(result); }
                  });
              });
          });
  &lt;/script&gt;
  </code></pre>