Problem
When you try to post data to the server using jQuery.Ajax function with type as "POST", you are not able to retrieve form data.
$("#bntAjax").click(function () {
$.ajax({
url: "jQueryAjaxData.aspx",
type: "POST",
dataType: "html",
async: false,
data: {
"ag": "randel"
},
success: function (obj) {
$("#divResult").text(obj);
}
});
});
In the above code, when you try to retrieve Request.Form["ag"], you get null when you post data from INTERNET EXPLORER (IE) browser.
Solution The solution is not to use IE but Google Chrome or FireFox as IE doesn't support form post method in javascript.
This is strange but true, alternatively you can create a WebMethod and you will be able to get these data to the server but for that you will have to use json.
Regards,
Sheo Narayan
http://www.dotnetfunda.com