Abhay Kalariya
asked on
Getting problem with http post method in angularJS to classic asp
Hi
I am new in angularJS.
i am working with classic asp and angularJS.
when i call http post method to classic asp page in angularJS its send data to classic asp page. but when i am try to retrieve posted data on classic asp page i found nothing?
is there i am doing wrong?
here is my code sample
----------Html code---------------
<div ng-app="CallSiteVisitor" ng-controller="SessionAndV isitor">
<form ng-submit="SaveData()" >
<input type="text" ng-model="form.firstname">
<input type="text" ng-model="form.lastname">
<input type="submit">
</form>
</div>
---------Html code end----------
-----------Controller code ------------
var app = angular.module('CallSiteVi sitor', ['fm']);
app.controller('SessionAnd Visitor', function($scope, $http) {
$scope.form = {};
$scope.SaveData = function() {
$http({
method : 'POST',
url : 'http://www.xyz.com/action_contactformAJ.asp',
data : $scope.form,
headers : { 'Content-Type': 'application/x-www-form-ur lencoded; charset=UTF-8' }
})
.success(function(data) {
if (data.errors) {
// error code
} else {
// data code
}
});
};
});
-----------Controller code end---------
---------- Classic asp page code (action_contactformAJ.asp) ---------- ---------- -----
<%
Response.write request("FirstName") & " " & request("LastName")
' here i found null value but when i see in browser by pressing f12 key in network mode its shown that when post method call its send data with text box values but on other side i found nothing.... is there i am doing some wrong things?
%>
---------- Classic asp page code end----------------------- -
please advice
thanks
Abhay
I am new in angularJS.
i am working with classic asp and angularJS.
when i call http post method to classic asp page in angularJS its send data to classic asp page. but when i am try to retrieve posted data on classic asp page i found nothing?
is there i am doing wrong?
here is my code sample
----------Html code---------------
<div ng-app="CallSiteVisitor" ng-controller="SessionAndV
<form ng-submit="SaveData()" >
<input type="text" ng-model="form.firstname">
<input type="text" ng-model="form.lastname">
<input type="submit">
</form>
</div>
---------Html code end----------
-----------Controller code ------------
var app = angular.module('CallSiteVi
app.controller('SessionAnd
$scope.form = {};
$scope.SaveData = function() {
$http({
method : 'POST',
url : 'http://www.xyz.com/action_contactformAJ.asp',
data : $scope.form,
headers : { 'Content-Type': 'application/x-www-form-ur
})
.success(function(data) {
if (data.errors) {
// error code
} else {
// data code
}
});
};
});
-----------Controller code end---------
---------- Classic asp page code (action_contactformAJ.asp)
<%
Response.write request("FirstName") & " " & request("LastName")
' here i found null value but when i see in browser by pressing f12 key in network mode its shown that when post method call its send data with text box values but on other side i found nothing.... is there i am doing some wrong things?
%>
---------- Classic asp page code end-----------------------
please advice
thanks
Abhay
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Try response.write request.form("FirstName")
and also in html, change the below
<input type="text" ng-model="form.firstname">
to
<input type="text" name = "FirstName" ng-model="form.firstname">