I try to pass parameters into aspx.cs
page from js
script. When I omit:
contentType: "application/json; charset=utf-8"
in ajax request I get by Request.Form["ORDER"]
sth like {%7b%22ORDER_ID%22%3a126333%7d}
. It means that this data comes to aspx.cs
, but it is not decoded.
When I add contentType
I get nothing in request.
Below I attach request.
It is important to read parameters from Request.Form["ORDER"]
in aspx.cs
;
$.ajax({
type: 'POST',
contentType: "application/json; charset=utf-8",
data: JSON.stringify({ ORDER_ID: orderKeyId }),
dataType: "json",
url: sUrl,
success: function (data) {
var s = 0;
},
error: function () {
var s = 0;
}
});