Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
644 views
in Technique[技术] by (71.8m points)

asp.net mvc - [HttpPost/HttpGet] vs. [AcceptVerbs(HttpVerbs.Post/Get)]

are these things the same?

[HttpPost/HttpGet] vs. [AcceptVerbs(HttpVerbs.Post/Get)]

if not where is a difference?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes, absolutely the same. [HttpPost/HttpGet] were introduced in ASP.NET MVC 2 to reduce the keystrokes we have to type :-) [AcceptVerbs(HttpVerbs.Post/Get)] could still be used and behave the same although if you are writing new code I would recommend the first.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...