i have ajax request to url DataProcessor.aspx like shown below ,how can i write asp.net c# code to extract the json data from request and display in DataProcessor.aspx page
var json = "{'ItemName':'" + escape(item.val()) + "','CategoryID':'" + category.val() + "','RecordID':'" + record.val() + "'}";
alert(escape(item.val()));
alert(category.val());
alert(record.val());
var ajaxPage = "DataProcessor.aspx?Save=1"; //this page is where data is to be retrieved and processed
var options = {
type: "POST",
url: ajaxPage,
data: json,
contentType: "application/json;charset=utf-8",
dataType: "json",
async: false,
success: function(response) {
//alert("success: " + response);
},
error: function(msg) { alert("failed: " + msg); }
};
//execute the ajax call and get a response
var returnText = $.ajax(options).responseText;
if (returnText == 1) {
record.html(returnText);
$("#divMsg").html("<font color=blue>Record saved successfully.</font>");
}
else {
record.html(returnText);
$("#divMsg").html("<font color=red>Record not saved successfully.</font>");
}
});
});