There is one more parameter to send with the request.
So this is my code so far:
$.post(url + "/SaveProfile", { xml: XML, configName: name}, function() {
alert("Saved");
});
I got this error :
A potentially dangerous Request.Form value was detected from the client
That is the serverside framework protecting you from people trying to do injections. There are ways to disable that for the page or for the entire site [I would not recommend doing that.] Easiest thing to do to get around it is to encode the string and unencode it on the server.