I've this piece of code that calls my handler, but i cant receive data in my handler, can you help?
//CLIENT SIDE
$("#saveChanges").click(function () {
$.ajax({
url: "../handlers/adminSaveResults.ashx",
type: "POST",
data: "{ 'pinNovo': '" + "123456" + "' }",
async: true,
contentType: "application/json; charset=utf-8",
dataType: 'json',
success: function (data) {
alert("Dados Guardados! ;)");
},
error: function (data) { alert("ERRO: " + data.status); },
timeout: 15000
});
}
//SERVER SIDE (adminSaveResults.ashx)
try
{
context.Response.ContentType = "text/json";
context.Response.Write(context.Request.QueryString["pinNovo"].ToString());
}
catch (Exception msg)
{
context.Response.Write(msg.Message);
}
And the result is allways the same, i've tried other options but allways with the same result: Object reference not set to an instance of an object.