405 - HTTP verb used to access this page is not allowed - MVC 4

478
Views
2
Answers

I need to post a model using jquery ajax to the action method in MVC4. When I am trying to post I get the error

405 - HTTP verb used to access this page is not allowed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

What does this error mean and why it is caused?

edit | flag
Sam Bells
Asked on: Mar 27, 2012 at 12:44AM

2 Answers

136
2
136

Make sure that your controller has a post method specified if you mention type: "POST" in the Ajax call and that matches with the URL.
If you use POST and there is no POST method in your controller you will get this error.
Make sure that you are not trying to post cross domain.

edit | flag
Gokul A
Answered on: Mar 27, 2012 at 12:52AM
169
0
169

yes, this is error come b'cause your model not supported post method or difference between posted variable and model variable. So, you make sure that your model support the post method and posted variable and model variable should be same.

edit | flag
sudhir singh
Answered on: Sep 11, 2013 at 5:04PM

Post your Answer

Search

Welcome to Ask Amoeba!
This is 100% free and interactive site for sharing professional Questions and Answers, Opensource projects, Interview questions.
Learners, beginners, Experts stop and share your knowledge and ideas!

Browse Categories

Browse Tags