How to use jQuery to make a call to c# file to get return value
- by aspdotnetuser
Hi,
I want to use jQuery to make a call to a c# web service called CheckUserName.ashx which checks whether that username is valid and returns an error message as a string.
How can I use to jQuery to do this? Would the code be something like the following?
jQuery.ajax({
type: "GET",
url: "/services/VerifyUsername.ashx",
data: "ErrorMessage",
success: function (msg) {
alert("success");
},
error: function (msg, text) {
alert(text);
}
});
});
Any help will be appreciated!
Thanks,