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

作者

zhang

发布于

2019-04-10

更新于

2023-09-19

许可协议

CC BY-NC-SA 4.0

Your browser is out-of-date!

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

×