ASP.NET, AJAX - 403 forbidden -


i'm getting error

**post http://localhost:34169/createnew.aspx.cs/confirm 403 (forbidden) ** 

when trying call codebehind function 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 codebehind function (doesnt anything, test things out):

[system.web.services.webmethod(bufferresponse = false)]         protected void confirm(string str) {             // skicka sql-query             response.write("funktionen kallas! " + str);         } 

i think mistake in url createnew.aspx.cs/confirm should change createnew.aspx/confirm. it's article calling asp.net webmethod using jquery ajax


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -