Here's what we need to know:
1 - does the success message get shown ?
2 - does the back end method get called ?
3 - is there a reason you need to use a webservice and not just an AJAX call ?
4 - have you debugged this in Chrome to see what happens when it runs ? Are there any javascript errors ?
I never use stringify, I just use an array of name/value pairs. Well, I've used stringify to serialise an entire form, that's about it. In fact, while I break it out, the line you commented out looks more like what I usually do. Here is an example of how I'd make an AJAX call:
var postData = {
urlIntegrated: urlIntegrated,
id: id,
password: $.trim($("#Password").val()),
secretQuestion: $("#SecretQuestionId").val(),
secretAnswer: $.trim($("#SecretAnswer").val())
};
$.post("/Home/StoreProfile", postData, function (data)
{
if (data.Saved)
{
jAlert("Profile Saved", "Success", function () {
window.location = "/";
});
}
else
{
jAlert("Profile save failed, please try again or contact our support.", "Error");
}
}, 'json');
I am posting to an ASP.NET MVC website. I am not sure if a web service will populate the values in the same way, but the way you wrote your method, is how it works fine for me in my site.
Just to add, building your SQL the way you are, anyone who wants to erase your DB, can. Read up on SQL injection attacks. You need to create paramaterized queries, or call stored procs.