Q:

Unable to get correct posted data from AJAX call in asp.net handler

I am calling a handler through a AJAX call . 
code
var PostData = {"MyName": myName };
$_.ajax(
        {
            type: "POST",
            async: true,                                
            url: 'SomeGenericHandler.ashx',                                
            data: JSON.stringify(PostData),
            success: function (msg)
            {
                var ObjJson = eval(msg);        
            },
            error: function (msg)
            {   
            }
        });

Inside ProcessRequest ,these values i am getting :  
context.Request.Form.Count = 1 
context.Request.Form[0] = "{'MyName':'dave'}"
context.Request.Form["MyName"] = null 

How can get the posted data as :
context.Request.Form["MyName"] = "dave" 
Thanks in advance :)

A:

You need to send the data in the format of the post as:
$_.ajax(
        {
            type: "POST",
            async: true,                                
            url: 'SomeGenericHandler.ashx',                                
            data: 'MyName=dave&MoreData=SecondName',
            success: function (msg)
            {
                var ObjJson = eval(msg);        
            },
            error: function (msg)
            {   
            }
        });

Also take a look at the encodeURIComponent, you may need to encode the parameters :
Combining two Javascript and jQuery scripts

