我在Document/Index页面上利用@Html.Action("ButtonList")加载了部分视图
下面是我控制器的方法
[ButtonAuthorize] public ActionResult ButtonList() { return PartialView("DocumentHandle"); }
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
string controller = httpContext.Request.RequestContext.RouteData.Values["controller"].ToString();
string action = httpContext.Request.RequestContext.RouteData.Values["action"].ToString();
string backPath = controller + "/" + action;
SysRoleFacade sysRoleFacade = new SysRoleFacade();
return sysRoleFacade.GetRoleMenu(UserHelper.CurrentUserID, backPath);
}
为什么我获取到的backPath永远都是Document/Index 而获取不到Document/
ButtonList???
已经解决了~自己弄错了拦截的地方,应该放在ACTION拦截里做就可以拿到了