Reputation: 32808
I have methods like this:
[HttpPost]
public ActionResult Delete(BaseViewModel vm) {
public ActionResult Delete(string ac) {
try {
From within my action filter is there a way that I can check if the method is a post or get ?
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
??
Upvotes: 18
Views: 7624
Reputation: 239694
The ActionExecutingContext
has a HttpContext
property. From there, you can obtain the Request
property, which has a HttpMethod
property, which tells you which method was used in this request.
Upvotes: 41