ASP.NET MVC 4 - ActionMethodSelectorAttribute
public class MyActionMethodSelectorAttribute:ActionMethodSelectorAttribute
{
public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo)
{
if ((controllerContext.HttpContext.Request["data"]) == "no")
return false;
return true;
}
}
public class HomeController : Controller
{
//
// GET: /Home/
[MyActionMethodSelectorAttribute()]
public string Index(string data)
{
return "I returned an string is "+data+"<br/>";
}
}
so as you can see
and