沒有方法Get的參數,代碼有效,但是如果方法詢問參數,則返回錯誤404。我如何正確地發送參數與Angular JS?Angular JS AJAX調用參數
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;
}
什麼是你的後盾? ASP.Net MVC? –
是的。 ASP .Net MVC – ElementaryStudentProgramming