ASP.NET MVC了405错误的HTTP DELETE请求? [英] ASP.NET MVC got 405 error on HTTP DELETE request?

查看:470
本文介绍了ASP.NET MVC了405错误的HTTP DELETE请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过使用JavaScript来删除一个URL在asp.net MVC但却我总是 405方法不允许的回报。

I'm trying to pass the DELETE to a URL in asp.net MVC using JavaScript but however i always got 405 Method not allow return.

反正是有使这项工作?

FYI:我已经把 [AcceptVerb(HttpVerb.Delete)] 属性我控制器上

FYI: I've put the [AcceptVerb(HttpVerb.Delete)] attribute on my controller.

DELETE /post/delete/8

这是请求

推荐答案

这是令人沮丧的我。这是因为WebDAVModule默认安装在IIS 7.5。通过移除模块,可以摆脱这种令人沮丧的限制。简单地说,

It was frustrating to me too. It is because WebDAVModule is installed by default on IIS 7.5. By removing the module, you can get rid of this frustrating restriction. Simply,

    <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true">
            <remove name="WebDAVModule"/> <- add this

从<一个href=\"http://shouldersofgiants.co.uk/Blog/post/2009/11/27/HTTP-Error-405-With-ASPNet-MVC-and-HTTP-PUT-on-IIS-75.aspx\">http://shouldersofgiants.co.uk/Blog/post/2009/11/27/HTTP-Error-405-With-ASPNet-MVC-and-HTTP-PUT-on-IIS-75.aspx

这篇关于ASP.NET MVC了405错误的HTTP DELETE请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆