I am facing an issue with the parameter clientId in my ASP.NET MVC Controller as it always seems to be null.
I have found that I can only pass data successfully if I create a class, but this becomes cumbersome as I cannot create a class for every backend function just to make this work.
Is there a way to pass data successfully without having to create a class?
Your assistance is greatly appreciated
Angular Factory
PlaylistsFactory.getUsersForClient = function (clientId) {
return $http({
method: 'POST',
url: '/Show/GetUsersForClient',
data: JSON.stringify(clientId)
});
};
Angular Controller
PlaylistsFactory.getUsersForClient(clientId)
.success(function (userList) {
console.log('Success!');
});
ASP.NET MVC Controller
public JsonResult GetUsersForClient(string clientId) //clientId is always null unless i create an object
{
...
}