title: Controller returns raw JSON object as view
body: <p>i'm using MVC architecture, i've a POST form as Bootstrap Modal that attach its form data after submit to an AJAX Call </p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: action,
      enctype: "multipart/form-data",
      data: dataString,
      cache: false,
      contentType: contentType,
      processData: processData,
      beforeSend: function () {
          block('#mymodal');
      },
      success: function (data, status, xhr) { console.log("success ajax"); onAjaxSuccess(xhr, status, '#mymodal') },
      error: function (xhr, status) { console.log("error ajax"); onAjaxFailed(xhr, status, error, '#error-div') },
      complete: function (xhr, status) { console.log("complete ajax"); onAjaxComplete(xhr, status, '#mymodal', '#alert', '#myModal') }
  });
  </code></pre>
  
  <p>where <strong>action</strong> is the Controller Method where it passes the required data, <strong>contentType</strong> and <strong>processData</strong> are both false</p>
  
  <p>this ajax call is working fine and sends the call to the controller correctly </p>
  
  <pre><code>public ActionResult MyCtroller(myViewModel model)
  {
      //processing stuff
  
      JsonResultObject result = new JsonResultObject();
  
      try
      {
         //return secess
      }
      catch (Exception ex)
      {
         //return error
      }
  
      SearchCriteria&lt;MyModel&gt; viewModel = new SearchCriteria&lt;MyModel&gt;();
      viewModel.SortExpression = m =&gt; m.OrderByDescending(a =&gt; a.Date);
      SearchResult&lt;MyModel&gt; searchResult = MyModelService.Instance.Search(viewModel);
  
      result.PartialViewHtml = RenderPartialViewToString("PartialView.cshtml", searchResult);
  
  
      return Json(result));
  }
  </code></pre>
  
  <p>after the processing is completed and it's time to return the page it print the result as pure JSON with the partial view in that JSON as object, instead of rendering the partialView and the <strong>success, complete, error</strong> in the Ajax call earlier doesn't get called  </p>
  
  <pre><code>{
    "IsRedirect": false,
    "RedirectUrl": null,
    "Success": true,
    "AlertMessage": {
     "IsAutoHide": false,
     "Dissmisable": true,
     "ShowIcon": false,
     "Message": "success",
     "AlertCSS": "alert alert-success",
     "AlertType": 3,
     "AlertTypeMetronic": "success"
  },
  "PartialViewHtml":"-----partialView HTML code-----"
  }
  </code></pre>