I use the same action name for both the GET and POST versions of my methods. I'd like to call the GET method even during a postback based on a condition. For example I added the following selector attribute:
public class NotFormAttribute : ActionMethodSelectorAttribute {
public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) {
return controllerContext.HttpContext.Request.QueryString["IsForm"] == null;
}
}
Now I have to go through and apply this to every POST action method in my application. This seems slightly tedious. I'd tried to register it as a global filter but it didn't allow it (as it doesn't implement IActionFilter).
Does anyone know how I can do this? Thanks