I got this error
System.InvalidOperationException: ManageUser Web Service method name is not valid. at System.Web.Services.Protocols.HttpServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
when I trying to call a webservice method from button click event using ajaxcall
$.ajax() {
type: "POST",
url: "RechargeService.asmx/ManageUser",
//data: "{objUser: " + JSON.stringify(objUsers) + "}",
data: "{Name:'" + Name + "',Address:'" + Address + "',City:'" + City + "',State:'" + State + "',Pincode:'" + Pincode + "',MobileNo:'" + MobileNo + "',Email:'" + Email + "',Password:'" + Password + "',Parameter:'" + Parameter + "',UserRole:'" + UserRole + "',UserStatus:'" + UserStatus + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
success: function (data) {
data = JSON.parse(data.d);
if (data.Sucess) {
$("#lblMsg").html('Registration done successfully');
$("#txtEmail").val('');
$("#txtPassword").val('');
$("#txtMobileNo").val('');
$("#txtConfirmPassword").val('');
$('#myModal1').hide();
alert("Your registration completed successfully");
} else {
alert("Already registered with this email id");
$("#txtEmail").val("");
}
},
error: function (xhr, status, error) {
alert(xhr.responseText + " \n " + status + " \n " + error);
alert("There was an error while processing. Please try again after some time.");
}
}
Method
[WebMethod]
Public string ManageUser()
{
}
This code works fine in local after hosting only i get the above error pls help me with this.. Thanks in advance