I'm getting the error
**POST http://localhost:34169/createNew.aspx.cs/Confirm 403 (Forbidden) **
when I am trying to call a CodeBehind function with Jquery AJAX.
My code:
function CallConfirmMethod(str) {
$.ajax(
{
type: "POST",
contentType: "application/json; charset=utf-8",
url: "createNew.aspx.cs/Confirm",
data: "{'smallPos': " + str + "}",
success: function (result) { alert("successful!"); }
});
}
And the CodeBehind function (doesnt actually do anything, just to test things out):
[System.Web.Services.WebMethod(BufferResponse = false)]
protected void Confirm(string str) {
// SKICKA SQL-QUERY
Response.Write("Funktionen kallas! " + str);
}