I am trying to get a data string from a jQuery POST to a aspx page. But no luck.
This is my jQuery
function namePerson() {
$.ajax({
type: "POST",
url: "names.aspx",
data: {name : "Anders"},
beforeSend: function() {
$("#ViewContainer").html("<img src='loading.gif' />");
},
success: function(msg){
$("#ViewContainer").html(msg);
}
});
}
And in the beginning of the aspx I have this
string strName = Request.QueryString["name"];
I can see the 'name' string is sent via debug in browser. But I am not able to retrieve it. I am coming from classic ASP and are trying to learn ASP.net C#. I have not been able to find any search result explaining how to do this.
Help much appreciated =)