0

I'm having problem with MVC 3 routing. I have this function in the Global.asax:

routes.MapRoute("Invitations",
                        "api/invitations",
                        new { controller = "Invitations", action = "Invitation" });

And i have a Controller:

public class InvitationsController : Controller
{
    [HttpPut]
    public JsonResult Invitation(InvitationResponse invitationResponse)
    {
        //code
    }
}

The problem is that i'm get the error NotFound or The resource cannot be found. Can anyone see the problem?

EDIT: The URL im using is "http://localhost:6055/API/Invitations"

user1156691
  • 233
  • 1
  • 4
  • 11
  • Could you post the route using in your browser – Jorge Nov 12 '12 at 18:28
  • So your javascript code is `PUT`ing a `InvitationResponse` to that url and you're getting the `NotFound` error? – JayC Nov 12 '12 at 18:37
  • can you post the URI you are using to access the resource? – Dakait Nov 12 '12 at 18:40
  • The URL is "http://localhost:6055/API/Invitations". – user1156691 Nov 12 '12 at 18:53
  • Check solution from this question, this might help with your Put: [http://stackoverflow.com/questions/8182620/put-or-delete-verb-in-asp-net-mvc-on-html-form][1] [1]: http://stackoverflow.com/questions/8182620/put-or-delete-verb-in-asp-net-mvc-on-html-form – Dima Nov 12 '12 at 19:08

0 Answers0