I am trying to do a post of a form in angular, but the input testValue doesn't get a value.
Any suggestions?
In the angularJs controller:
//FORM
$scope.submitEditSyncSettingsForm = function () {
if ($("#editSyncSettingsForm").valid()) {
$http({
url: "data/postSyncSettings.aspx",
data: { testValue: 'some value' },
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }
}).success(function (data) {
console.log(data)
}).error(function (err) { "ERR", console.log(err) })
}
};
.aspx code behind
public partial class postSyncSettings : System.Web.UI.Page
{
protected string strResponse = "";
protected void Page_Load(object sender, EventArgs e)
{
strResponse = Request.Form["testValue"];
}
}