I am getting this error after trying to implement paging support.
I am on this step of the html tutorial: http://nerddinnerbook.s3.amazonaws.com/Part8.htm
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The error you are getting tells that ASP.NET MVC has found two actions with the same name and can’t chose which to use.
If you have two Index-actions in your
DinnersController.cs:and:
Then you should remove the first Action. since the second is the ‘updated’ version of the first.
The second Action accepts requests to:
/Dinners
/Dinners?page=2
/Dinners/Index
/Dinners/Index?page=2
And with the change in RegisterRoutes it also accepts requests to:
/Dinners/Page/2
You can have two Actions with the same name, providing one is for saving (postbacks), where you decorate the saving action with
[AcceptVerbs(HttpVerbs.Post)]or just[HttpPost]