title: ASPNET MVC: I get "The view X or its master was not found or no view engine..." Error on Method that return JSON ContentResult
body: <p>I have a method that return json ContentResult. I call on from JavaScript file like this:</p>
  
  <pre><code> $scope.GetUserRoles = function () {
          $http({
              method: "GET",
              url: Current.VirtualUrl + "Store/Counting/GetUserRoles"
          }).then(function mySucces(response) {
              if (response.data.Status == 1) {
                  $scope.UserRoles = response.data.Data;
  
                  $scope.GetCountingList(0, false, "CountingId", "DESC");
              }
              else {
                  console.log(response);
                  $scope.ShowMessage(msgWarning, msgDataFromServerFail + response.data.Data);
              }
          }, function myError(response) {
          });
      }
  </code></pre>
  
  <p>When calling here <strong>GetUserRoles method doesn't fire and Response.Data get this error</strong>:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link href="/MySite/Assets/css/pages/error.css" rel="stylesheet" /&gt;
  
      &lt;div class="page-500-full-page"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-md-12 page-500"&gt;
                  &lt;div class=" number"&gt;
                      500
                  &lt;/div&gt;
                  &lt;div&gt;
                      &lt;h3&gt;Oops! Something went wrong.&lt;/h3&gt;
                      &lt;p&gt;
  The view &amp;#39;GetUserRoles&amp;#39; or its master was not found or no view engine supports the searched locations. The following locations were searched:
  ~/Areas/iStore/Views/Counting/GetUserRoles.aspx
  ~/Areas/iStore/Views/Counting/GetUserRoles.ascx
  ~/Areas/iStore/Views/Shared/GetUserRoles.aspx
  ~/Areas/iStore/Views/Shared/GetUserRoles.ascx
  ~/Views/Counting/GetUserRoles.aspx
  ~/Views/Counting/GetUserRoles.ascx
  ~/Views/Shared/GetUserRoles.aspx
  ~/Views/Shared/GetUserRoles.ascx
  ~/Areas/iStore/Views/Counting/GetUserRoles.cshtml
  ~/Areas/iStore/Views/Counting/GetUserRoles.vbhtml
  ~/Areas/iStore/Views/Shared/GetUserRoles.cshtml
  ~/Areas/iStore/Views/Shared/GetUserRoles.vbhtml
  ~/Views/Counting/GetUserRoles.cshtml
  ~/Views/Counting/GetUserRoles.vbhtml
  ~/Views/Shared/GetUserRoles.cshtml
  ~/Views/Shared/GetUserRoles.vbhtml                    &lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Any help will be much appreciated.</p>
  
  <p>Thanks in advance.</p>