我想使用web服务删除Angular JS中的一行但无法执行。这里是我的代码:的script.js无法删除Angular JS中的行
$scope.DeleteEmployee = function (EID) {
var data = $.param({
EID: $scope.EmpId
});
var config = {
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
}
$http.post("EmpWebService.asmx/DeleteEmployee", EID, config)
.then(function (response) {
alert("Deleted successfully.");
$scope.getEmployee();
});
}
employee.aspx
<td>
<a href="#" ng-click="DeleteEmployee(employee.EmpId)">Delete</a>
</td>
我得到员工ID中的script.js如EID但F12调试后,这个错误就要 http://localhost:55735/EmpWebService.asmx/DeleteEmployee 500(内部服务器错误)
你能发布有关错误的更多细节吗?像堆栈跟踪 –
我认为你的问题与AngularJS无关,而是与你的服务器实现有关。请检查您发送到您的服务器(仍F12),服务器响应主体(如果有)的参数类型。 – Neozaru