Please provide some code. Please help me..
Example Data :
Roll No Student Name Course
1001 Sachin MCA
1002 Sehwag MBA
<script>
var app = angular.module("myApp", []);
app.controller("myCntrl", function ($scope, $http) {
$scope.Save = function () {
var httpreq = {
method: 'POST',
url: 'home.aspx/Save',
headers: {
'Content-Type': 'application/json; charset=utf-8',
'dataType': 'json'
},
data: {
studentID: $scope.rollNo,
studentName: $scope.studentName,
studentDept: $scope.deptName,
active: $scope.IsActive,
createBy: $scope.createBy,
createDate: $scope.createDate
}
}
$http(httpreq).success(function (response) {
$scope.fillDeptList();
alert("Saved successfully.");
})
};
$scope.Department; // It already bind in dropdownlist
$scope.fillDeptList = function () {
var httpreq = {
method: 'POST',
url: 'home.aspx/GetDeptList',
headers: {
'Content-Type': 'application/json; charset=utf-8',
'dataType': 'json'
},
data: {}
}
$http(httpreq).success(function (response) {
$scope.Department = response.d;
})
};
$scope.fillDeptList();
});
</script>
it's work fine and save into db, but show some error after save.
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.