I use ajax in my applicataion, and I have to use the $.post method.
Normally, the data sent to server are key-value paires. I can get them through:
HttpContext.Current.Request.QueryPara['name'];
....
But in some cases, the data to be sent to the server does not contain the name.
It is just a xml segments.
Like this:
var data='<data>xxxxx<data>';
$.post('http://server/service.asmx/test',data,function(){
//callback
},'xml');
Then How can I get the data in my webmethod?
You should have to use ‘json’ dataType to pass data to the web-method.
Have a look at sample:
Service.asmx
and JavaScript code to request this webmethod