Hi All, I have a situation where I have to send a large text in ajax request using method :POST. I have tried to do like this.
new Ajax.Request(url + "?" + params, {
method: 'post',postBody: {'Test':'Test'}, onSuccess: function (transport) {
switch (transport.responseJSON.Status) {
case "Success":
// alert(transport.responseJSON.Message);
var imgDiv = document.getElementById(control);
imgDiv.style.display = 'none';
break;
case "Failed":
alert(transport.responseJSON.Message);
break;
case "NotAuthorized":
alert(transport.responseJSON.Message);
break;
case "LoginRequired":
window.location = transport.responseJSON.RedirectAfterLogin;
break;
}
}
});
Test in post body will be replaced with large text from a text area. But when I try to access it on server like this
string test = context.Request["Test"];
I get null. Any solution reference to an example? Thanks