asp.net mvc get controller name and action name

@{
var controller = @HttpContext.Current.Request.RequestContext.RouteData.Values["controller"].ToString();
var action = ViewContext.Controller.ValueProvider.GetValue("action").RawValue;

}

posted @   zyip  阅读(245)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示