Dmitriy Reznik
Dmitriy Reznik

Reputation: 99

HttpPost in MVC 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.

Upvotes: 1

Views: 57

Answers (1)

mikeswright49
mikeswright49

Reputation: 3416

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

[AcceptVerbs(HttpVerbs.Post)]

or

[AcceptVerbs(HttpVerbs.Get)] 

etc.

Upvotes: 2

Related Questions