如何确定 GET 还是 POST 命中了我的 ASP.NET MVC Controller 操作?
最佳答案
您可以查看 Request.HttpMethod
为了那个原因。
if (Request.HttpMethod == "POST") {
//the controller was hit with POST
}
else {
//etc.
}
关于asp.net-mvc - C# ASP.NET MVC : Find out whether GET or POST was invoked on controller action,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1169490/