ASP.Net MVC action 同时支持Get和Post

项目中遇到一个action,有post和get请求,特此记录方法:
在action 上加上 AcceptVerbs标签:

1
2
[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)]
public ActionResult Index()

转自:https://blog.csdn.net/Helloantoherday/article/details/85007344

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×