日期:2014-05-20 浏览次数:20886 次
public class AdminFilter : ActionFilterAttribute
{
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
base.OnActionExecuted(filterContext);
}
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
//判断是否登陆
}
}
//Filter类
[AdminFilter]
public class AdminController : Controller
{
public ActionResult Admin()
{
return View();
}
}