For my angular controller I have:
app.controller('AdminCtrl', function ($scope, $http) {
$scope.data = {
Name: '',
Password: ''
},
$scope.login = function (data) {
$http({
method: 'POST',
url: '/login/postlogin',
data: JSON.stringify({
data: $scope.data
}),
contentType: "application/json",
dataType: "json"
}).success(function (data) {
alert('success!');
}).error(function (error) {
alert(error.message);
})
}
});
For my c# controller I have a very basic setup:
[HttpPost]
public string PostLogin(string data) {
return string.Empty;
}
My issue is that inside of the c# controller, data is always null. Does anyone know how to pass the name and password params over to the c# controller? I know for a fact that I am recieving values for them from my textboxes that I have. Thanks!
EDIT:
I will recieve the success message/alert.