Skip to content
Advertisement

getting error while deleting record in the table – method not allowed “405 (Method Not Allowed)”

i want to delete record using ajax call but im getting error method not allowed. 405 error.

code

HTML

JavaScript

JS

JavaScript

c# code

JavaScript

Advertisement

Answer

I test my code,and I find HTTPDelete and HttpPost can work.

Here is a demo for HTTPDelete:

View:

JavaScript

controller:

JavaScript

Result: enter image description here

Here is a demo for HTTPPost:

View:

JavaScript

controller:

JavaScript

Result: enter image description here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement