Problems with the IIS and the database

1

A few days ago I published my MVC + AngularJs application in IIS. Everything works fine except the database, the GET, ECT requests do not want to work ...

Launches the following exception:

  

This Request has been blocked because sensitive information could be reported to thir party web systems when this is used in a Get Request. to allow Get Request, set JsonRequestBehavion to allow get

This is the connection in my appconfig:

data source=10.xx.xx.93,1433;initial catalog=TrackingSystem;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework

And this is my controller:

[HttpGet]
public JsonResult GetData(String St)
{
    JsonConvert.SerializeObject(DateTime.Now);
    try
    {
        HandlingUnitRepository ZH = new HandlingUnitRepository();
        return Json(ZH.GetData(St), JsonRequestBehavior.AllowGet);
    }
    catch
    {
        return Json("Error al intentar obtener la data!");
    }

My request in angularjs:

$scope.GetData = function (select) {
    $scope.Loading = true;

    //Peticion Get para obtener el listado de ZourfReport
    $http({
        method: "GET",
        url: "http://localhost:8082/HandlingUnit/GetData?St=" + select,

    }).then(function mySuccess(response) {
        $scope.Data = response.data;
        $scope.Data.DateShipped;

    }, function myError(response) {
        $scope.Data = response.statusText;
    });
    
asked by AlejandroMst 15.08.2018 в 14:36
source

1 answer

1

The function is entering the catch due to some error and in the catch you are not enabling the requests get , which are blocked by default in the version of MVC you are using

Change the sentence to

return Json("Error al intentar obtener la data!", JsonRequestBehavior.AllowGet);

greetings

    
answered by 15.08.2018 в 14:58