Dan
Dan

Reputation: 1262

Routing error using MVC on iis 5.1

I am using .NET MVC 2 with Windows XP (IIS 5.1). I have set up wildcards per this blog.
The problem I run into is sometimes when I call some of my actions, they are returning 404 errors. Here's how I'm calling them (using a button):

            <% using (Html.BeginForm("MyController", "MyAction")){ %>
        <input type="submit" value="Submit" />
        <% } %>

I'm thinking it might have to do with my buttons, but I'm not sure. My actions are accepting Posts only. Any ideas?

Upvotes: 0

Views: 239

Answers (1)

Anthony Potts
Anthony Potts

Reputation: 9160

Re: 404 errors:

Did you do all the fancy setup for the URL rewriting in MVC for IIS 5.1? I have not been able to get that to work correctly for me, so I ALWAYS debug to see my stuff ASP.NET MVC stuff on my XP Pro machine. When I deploy to the IIS 7 environment, I don't have any problems.

Re: Posts only:

Are you decorating the ActionResults with AcceptVerbs? If you decorate it with [AcceptVerbs(HttpVerbs.Post)] then that is the only verb that an action will allow.

Upvotes: 1

Related Questions