title: Return view with jquery ajax
body: <p>I would like to return a view inside of Ajax Success in my Jquery. </p>
  
  <ul>
  <li><p>This is my <code>[HttpPost]</code> MVC Action, decorated with <strong>HttpPost</strong></p>
  
  <pre><code>public ActionResult Search(SearchOrder order) 
  {
      if (Session["UserID"] != null)
      {
          var results = orderPresenter.GetSearchOrderSearchResult("CUSTOMER", null, currentSettings.CompanyId,
              currentSettings.CustomerId.ToString(), "-1", "1", "1752", "2993", "", -1,
              "", -1, "91387", "1", "1", "454545", "", "4", 1, "", "404", "78",
              "-1", DateTime.Parse("09/29/2015"), DateTime.Parse("10/01/2015"),
              null, null, currentSettings.UserSecurityLevel.ToString(),
              currentSettings.UserId.ToString(), "2", "");
          return View("SearchResults", results);
      }
      else
          return RedirectToAction("Login", "Account");
  
  }
  </code></pre>
  
  <p><strong>This is my view from which HTTPPost is being done</strong></p>
  
  <pre><code>@{
  ViewBag.Title = "SearchOrder";
  Layout = "~/Views/Shared/_MasterLayout.cshtml";
  }
  
              &lt;div class="row" style="margin-top:40px;"&gt;
                  &lt;div class="col-md-7"&gt;
                      &lt;label class="control-label col-md-3"&gt;Tracking #&lt;/label&gt;
                      &lt;div class="col-md-4"&gt;
                          &lt;input name="Tracking" size=5 maxlength=5 onkeypress="return numbersonly(this, event)" style="width:50px;"&gt;
                          -&lt;input name="Tracking" size=5 maxlength=5 onkeypress="return numbersonly(this, event)" style="width:50px;"&gt;
                          - &lt;input name="Tracking" size=5 maxlength=5 onkeypress="return numbersonly(this, event)" style="width:50px;"&gt;
                      &lt;/div&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;label class="control-label col-md-3"&gt;Order PO:&lt;/label&gt;
                      &lt;div class="col-md-4"&gt;
                          &lt;input type="text" style="width:100%;" /&gt;
                      &lt;/div&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;label class="control-label col-md-3"&gt;Reference:&lt;/label&gt;
                      &lt;div class="col-md-4"&gt;
                          &lt;input type="text" style="width:100%;" /&gt;
                      &lt;/div&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;label class="control-label col-md-3"&gt;SKU:&lt;/label&gt;
                      &lt;div class="col-md-4"&gt;
                          &lt;input type="text" style="width:100%;" /&gt;
                      &lt;/div&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label class="control-label col-md-3"&gt;Country:&lt;/label&gt;
                          &lt;div class="col-md-4"&gt;
                              &lt;select class="form-control input-xlarge select2me select2-offscreen" data-placeholder="Select..." tabindex="-1" title="" id="form-controls"&gt;
                                  &lt;option value=""&gt;&lt;/option&gt;
                                  &lt;option value="AL"&gt;Option&lt;/option&gt;
                                  &lt;option value="WY"&gt;Option&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label class="control-label col-md-3"&gt;Delivery Address:&lt;/label&gt;
  
  
                          &lt;div class="col-md-4"&gt;
                              &lt;select class="form-control input-xlarge select2me select2-offscreen" data-placeholder="Select..." tabindex="-1" title="" id="form-controls"&gt;
                                  &lt;option value=""&gt;&lt;/option&gt;
                                  &lt;option value="AL"&gt;Option&lt;/option&gt;
                                  &lt;option value="WY"&gt;Option&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label class="control-label col-md-3"&gt;Users:&lt;/label&gt;
  
  
                          &lt;div class="col-md-4"&gt;
                              &lt;select class="form-control input-xlarge select2me select2-offscreen" data-placeholder="Select..." tabindex="-1" title="" id="form-controls"&gt;
                                  &lt;option value=""&gt;&lt;/option&gt;
                                  &lt;option value="AL"&gt;Option&lt;/option&gt;
                                  &lt;option value="WY"&gt;Option&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label class="control-label col-md-3"&gt;Supplier:&lt;/label&gt;
  
  
                          &lt;div class="col-md-4"&gt;
                              &lt;select class="form-control input-xlarge select2me select2-offscreen" data-placeholder="Select..." tabindex="-1" title="" id="form-controls"&gt;
                                  &lt;option value=""&gt;&lt;/option&gt;
                                  &lt;option value="AL"&gt;Option&lt;/option&gt;
                                  &lt;option value="WY"&gt;Option&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label class="control-label col-md-3"&gt;Manufacturer:&lt;/label&gt;
  
  
                          &lt;div class="col-md-4"&gt;
                              &lt;select class="form-control input-xlarge select2me select2-offscreen" data-placeholder="Select..." tabindex="-1" title="" id="form-controls"&gt;
                                  &lt;option value=""&gt;&lt;/option&gt;
                                  &lt;option value="AL"&gt;Option&lt;/option&gt;
                                  &lt;option value="WY"&gt;Option&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
  
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label class="control-label col-md-3"&gt;Category:&lt;/label&gt;
  
  
                          &lt;div class="col-md-4"&gt;
                              &lt;select class="form-control input-xlarge select2me select2-offscreen" data-placeholder="Select..." tabindex="-1" title="" id="form-controls"&gt;
                                  &lt;option value=""&gt;&lt;/option&gt;
                                  &lt;option value="AL"&gt;Option&lt;/option&gt;
                                  &lt;option value="WY"&gt;Option&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
                  &lt;div class="col-md-4"&gt;
  
  
  
                      &lt;div class="form-group"&gt;
                          &lt;label class="col-md-3 control-label"&gt;Order Status:&lt;/label&gt;
                          &lt;div class="col-md-9"&gt;
                              &lt;select class="form-control" multiple=""&gt;
                                  &lt;option&gt;Option 1&lt;/option&gt;
                                  &lt;option&gt;Option 2&lt;/option&gt;
                                  &lt;option&gt;Option 3&lt;/option&gt;
                                  &lt;option&gt;Option 4&lt;/option&gt;
                                  &lt;option&gt;Option 5&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label class="col-md-3 control-label"&gt;Parts: &lt;/label&gt;
                          &lt;div class="col-md-9"&gt;
                              &lt;select class="form-control" multiple=""&gt;
                                  &lt;option&gt;Option 1&lt;/option&gt;
                                  &lt;option&gt;Option 2&lt;/option&gt;
                                  &lt;option&gt;Option 3&lt;/option&gt;
                                  &lt;option&gt;Option 4&lt;/option&gt;
                                  &lt;option&gt;Option 5&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label class="col-md-3 control-label"&gt;Bundles:&lt;/label&gt;
                          &lt;div class="col-md-9"&gt;
                              &lt;select class="form-control" multiple=""&gt;
                                  &lt;option&gt;Option 1&lt;/option&gt;
                                  &lt;option&gt;Option 2&lt;/option&gt;
                                  &lt;option&gt;Option 3&lt;/option&gt;
                                  &lt;option&gt;Option 4&lt;/option&gt;
                                  &lt;option&gt;Option 5&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label class="control-label col-md-3"&gt;Ordered After:&lt;/label&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;div class="input-group input-medium date date-picker" data-date="12-02-2012" data-date-format="dd-mm-yyyy" data-date-viewmode="years"&gt;
                                  &lt;input type="text" class="form-control" readonly&gt;
                                  &lt;span class="input-group-btn"&gt;
                                      &lt;button class="btn default" type="button"&gt;&lt;i class="fa fa-calendar"&gt;&lt;/i&gt;&lt;/button&gt;
                                  &lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label class="control-label col-md-3"&gt;Ordered Before:&lt;/label&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;div class="input-group input-medium date date-picker" data-date="12-02-2012" data-date-format="dd-mm-yyyy" data-date-viewmode="years"&gt;
                                  &lt;input type="text" class="form-control" readonly&gt;
                                  &lt;span class="input-group-btn"&gt;
                                      &lt;button class="btn default" type="button"&gt;&lt;i class="fa fa-calendar"&gt;&lt;/i&gt;&lt;/button&gt;
                                  &lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label class="control-label col-md-3"&gt;Shipped After:&lt;/label&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;div class="input-group input-medium date date-picker" data-date="12-02-2012" data-date-format="dd-mm-yyyy" data-date-viewmode="years"&gt;
                                  &lt;input type="text" class="form-control" readonly&gt;
                                  &lt;span class="input-group-btn"&gt;
                                      &lt;button class="btn default" type="button"&gt;&lt;i class="fa fa-calendar"&gt;&lt;/i&gt;&lt;/button&gt;
                                  &lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label class="control-label col-md-3"&gt;Shipped Before: &lt;/label&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;div class="input-group input-medium date date-picker" data-date="12-02-2012" data-date-format="dd-mm-yyyy" data-date-viewmode="years"&gt;
                                  &lt;input type="text" class="form-control" readonly&gt;
                                  &lt;span class="input-group-btn"&gt;
                                      &lt;button class="btn default" type="button"&gt;
                                          &lt;i class="fa fa-calendar"&gt;&lt;/i&gt;
                                      &lt;/button&gt;
                                  &lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
  
                      &lt;div class="clearfix"&gt;&lt;/div&gt;
  
                      &lt;div class="row"&gt;
  
                          &lt;div class="col-md-3"&gt;&lt;/div&gt;
                          &lt;div class="col-md-9"&gt;
                              &lt;button type="button" class="btn btn-default" style="float:right; margin-left:20PX; " id="per"&gt;Reset&lt;/button&gt;
                              &lt;a href="#"&gt;
  
                                  &lt;button id="btnSearchOrder" type="button" class="btn btn-default" style="float:right;  margin-left:20PX;" id="per" onclick=""&gt;Search&lt;/button&gt;
  
  
  
  
                              &lt;/a&gt;
  
                          &lt;/div&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
  </code></pre>
  
  
  
  <pre><code>$('#btnSearchOrder').click(function () {
  
  
      var searchParam={
          'STrackNo': '123',
          'OrderPO': '187'
  
      };
  
  
      $.ajax({
          url: '/Order/Search',
          type: 'POST',
          data: searchParam,
          success: function (data) {
  
  
          }
  
  
      })
  
  
  })
  </code></pre>
  
  
  
  <p><strong>This is View to return from Http POST action</strong></p>
  
  <pre><code>@model List&lt;OneSourceCore.ViewModel.SearchOrder&gt;
  
  @{
  ViewBag.Title = "SearchOrder";
  Layout = "~/Views/Shared/_MasterLayout.cshtml";
  }
  
  
  
  &lt;div&gt;
  
  
  @using GridMvc.Html;
  
  @if(Model!=null)
  { 
  
  @Html.Grid(Model).Columns(columns =&gt;
        {
            columns.Add(C =&gt; C.TrackingNo).Sortable(true).Filterable(true).Titled("Tracking No").SetWidth(30);
            columns.Add(C =&gt; C.OrderPO).Sortable(true).Filterable(true).Titled("Order PO").SetWidth(200);
            columns.Add(C =&gt; C.DestPORef).Sortable(true).Filterable(true).Titled("Dest P.O").SetWidth(30);
            columns.Add(C =&gt; C.OrderDate).Sortable(true).Filterable(true).Titled("Order Date").SetWidth(30);
            columns.Add(C =&gt; C.ETS).Sortable(true).Filterable(true).Titled("ETS").SetWidth(30);
            columns.Add(C =&gt; C.DeliveryAddress).Sortable(true).Filterable(true).Titled("Delivery Address").SetWidth(30);
            columns.Add(C =&gt; C.Status).Sortable(true).Filterable(true).Titled("Status").SetWidth(30);
            columns.Add(C =&gt; C.Total).Sortable(true).Filterable(true).Titled("Total").SetWidth(30);
            columns.Add(C =&gt; C.Currency).Sortable(true).Filterable(true).Titled("Currency").SetWidth(30);
        }).WithPaging(15)
  }
  </code></pre>
  
  <p></p></li>
  </ul>