i'm trying to pass data from AngularJS to ASP.net MVC and is always getting null. Here's my code (only posting the essential, button, controller and c#:
HTML:
<a class="btn btn-grey btn-lg btn-block" ng-click="AddCar()">Save</a>
Controller
$scope.AddCar = function () {
$http.post("Cars/AddCar", JSON.stringify($scope.new.JsonCar)).success(function (data) {
Alert(ok)
})
c#
public string AddCar(string JsonCar)
{
try
....
}
In JSON.stringify($scope.new.JsonCar) i'm getting this:
"{"Name":"FIAT 500","Description":"New car","MaxUserCapacity":5,"PhotoPath":"none"}"
What i'm doing wrong?