Вопрос

I'm trying to execute a delete request via jQuery to a controller. Locally it works but when deployed to the server I receive a 501 status.

I have confirmed that for .cshtml that all verbs are accepted and that file verification is not needed (I read this elsewhere but I don't see what it would achieve anyway as I am not calling a cshtml page). Is there some other application extension I need to change allowances for?

Это было полезно?

Решение

I have confirmed that for .cshtml that all verbs are accepted and that file verification is not needed

Except that in ASP.NET MVC you are not sending requests to .cshtml files. In ASP.NET MVC you are sending requests to controller actions. And they depend on your routing configuration. Out of the box IIS 6.0 doesn't support extensionless urls, so you cannot use the default routes unless you configure IIS.

So you will have to allow the DELETE verb to whatever extension you are using in IIS 6.0, or if you have configured extensionless urls, you will need to enable it for the aspnet_isapi extension.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top