Mostly it means that your Web Server is not recognizing the HTTP method(GET,POST,DELETE,PUT
...) in the request.
First, check in the RouteConfig.cs file which action run by defult.
routes.MapRoute(name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
In this case we have action Index from Home controller that was set by default.
Then, check that action. Is there any attributes like: [HttpPost]
, [HttpDelete]
, [HttpPut]
, ...
If you use attribute then you maybe need to make small changes in ApplicationHost.config file to enable it:
- Open in notepad the file:
%windir%\system32\inetsrv\config\applicationhost.config
- In the ApplicationHost.config file, locate the
<handlers
> tag.
- Make sure that all the handlers use valid HTTP methods.
- Save the ApplicationHost.config file.