I am trying to call code behind method from JS but it gives me this error
NetworkError: 401 Unauthorized
Here is the code behind method
[System.Web.Services.WebMethod]
public string ExtractToPDF(string FSID)
{
return FSID;
}
and here is the JS Function
function extractFile(FSID) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Update.aspx/ExtractToPDF",
data: "{"+FSID+"}",
dataType: "json",
success: function(data) {
alert(data)
},
error: function(result) {
alert("Error");
}
});
}
Here is the response
{
"Message": "An error occurred during the processing of the request",
"StackTrace": "",
"ExceptionType": ""
}