I have a jQuery post method with JSON data included.
In my httphandler, in the processRequest method, Request["Operation"] is null and none of my data is posted. I am in a SharePoint 2010 environment.
public void ProcessRequest(HttpContext context)
{
try
{
string operation = context.Request["Operation"]; // Returns null
My JavaScript is as follows:
function CallService(serviceData, callBack) {
$.ajax({
type: "POST",
url: ServiceUrl,
data: { Operation : "activate"},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
callBack(result);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.responseText);
}
});
In the debugger in VS I can't find the posted values when I evaluate the HttpContext. In Firebug, the value is posted as valid JSON data. Any reason why I cant get the parameters?
Any help appreciated.