I need to filter only methods from all actions which have return type ActionResult from controller actions. I am getting controller name and action name from following..
string originController = filterContext.RouteData.Values["controller"].ToString();
string originAction = filterContext.RouteData.Values["action"].ToString();
but how can i filter only method which have return type ActionResult?
Try this kind of code for accessing Controllers, Actions as well as
string originController = filterContext.RouteData.Values["controller"].ToString();
string originAction = filterContext.RouteData.Values["action"].ToString();
string originArea = String.Empty;
if (filterContext.RouteData.DataTokens.ContainsKey("area"))
originArea = filterContext.RouteData.DataTokens["area"].ToString();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With