开发者

ASP.NET MVC 3 setup for IIS7.5 with RESTful Verbs

I have a restful controller that has your standard REST HTTP Verbs: Get,Post, Put, Delete. The problem I am having is that although my controllers are dec开发者_开发百科orated to accept these verbs, when I execute my REST action, it can only hit my Get and Post methods.

I have the attributes on top of the controller actions: HttPut, HttpDelete, HttpPost, and HttpGet.

I also have the the override method in my forms: @Html.HttpMethodOverride(HttpVerbs.Put)

When I submit my form, I get a 404 error from IIS 7.5, saying the static file handler couldn't find the resource. Strangely the same forms work in Cassini, so I think it is something in IIS7.5's setup.

What do I need to do to get IIS 7.5 to handle REST verbs like PUT and DELETE with Asp.Net MVC 3?

I have already removed WebDAV and have looked through the handlers but the ones I am modifying seem to do nothing.

My current setup is Asp.Net MVC 3, IIS7.5 on Windows 7.

Thanks in Advance.


The solution is to remove the WebDAV module, but I was also using Restful-Routing library and it turned out to be a minor bug in that code that was causing strange behavior. Patched it and now it works! –

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜