without Get method parameters, the code works, but if the method requests a parameter, error 404 is returned. How to send parameters correctly using Angular JS?
factory.test = function () { var q = $q.defer(); $http({ method: "GET", url: url + "/dataEntry/test", data: { sampletext : "sample" } }) .success(function (data, status, headers, config) { q.resolve(data); }) .error(function (data, status, headers, config) { q.reject(data); }); return q.promise; };
[Route("test")] public String Get(string sampletext) { return "Reply coming from data entry controller" + sampletext; }
javascript angularjs ajax parameters asp.net-mvc
ElementaryStudentProgramming
source share