Don't JSON.stringify
the data if it is just key/value pairs like this. Do a form post:
$('#json_form').submit(function (event) {
event.preventDefault();
var url = $(this).attr('action');
var datos = {
"uno": "lalala",
"dos": "jojojo"
}
//var data = JSON.stringify(datos); no need for this
$.post(url, datos, function (resultado) {
$('#posted_values').html(resultado);
});
});
Then the values are available from Request["uno"]
and Request["dos"]
If you ever do need to use JSON.stringify
(which you would for more complex data structures), the JSON is transmitted in the Request body, so you need to extract it from Request.InputStream
:
var reader = new StreamReader(Request.InputStream);
var json = reader.ReadToEnd();