1

I have to maintain a project that uses MVC 1. It seems like it doesn't know anything about [HttpPost], and the same action method is called for both get and post. What is the right way to distinguish between creating a view and submitting the form data?

Thanks.

Liam
  • 22,818
  • 25
  • 93
  • 157
  • possible duplicate of [post and get with same method signature](http://stackoverflow.com/questions/724386/post-and-get-with-same-method-signature) – Liam Jun 18 '15 at 16:00
  • No, it is not a duplicate. I did not try to use the same signature. – Dmitriy Reznik Jun 19 '15 at 14:12

1 Answers1

2

MVC 1 is ancient but in order to do that you use the AcceptVerbs attribute

[AcceptVerbs(HttpVerbs.Post)]

or

[AcceptVerbs(HttpVerbs.Get)] 

etc.

mikeswright49
  • 3,283
  • 16
  • 22