本文介绍了asp.net mvc的 - [HttpPost / HTTPGET]对的[AcceptVerbs(HttpVerbs.Post/Get)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些东西一样吗?

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

如果不是哪里是区别?

推荐答案

是的,绝对是一样的。 [HttpPost / HTTPGET] 在ASP.NET MVC 2被引入,以减少我们必须键入:-) 击键的[AcceptVerbs(HttpVerbs.Post/获取)] 仍然可以使用,并且具有相同的行为但如果你正在写新的code,我建议第一。

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.

这篇关于asp.net mvc的 - [HttpPost / HTTPGET]对的[AcceptVerbs(HttpVerbs.Post/Get)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 13:53