comfreakph comfreakph - 1 month ago 10
Ajax Question

Can't access the code behind using ajax post in asp.net

This is my code behind:

enter image description here

This is my KO Script:

enter image description here

this is the result when I click my submit button
enter image description here

I there anything wrong with my code?

Answer

I have downloaded your solution and got it working

In App_Start\RouteConfig.cs you have the following line which needs to be removed:

settings.AutoRedirectMode = RedirectMode.Permanent;

Also your web method needs to be static

Comments