如何在某个action方法中获取它所在的控制器和action名称呢。
string controllerName = Request.RequestContext.RouteData.Values["controller"].ToString();//获取控制器名 string actionName = Request.RequestContext.RouteData.Values["action"].ToString();//获取action名
如何在某个action方法中获取它所在的控制器和action名称呢。
string controllerName = Request.RequestContext.RouteData.Values["controller"].ToString();//获取控制器名 string actionName = Request.RequestContext.RouteData.Values["action"].ToString();//获取action名
转载于:https://www.cnblogs.com/senyier/p/7609297.html