码迷,mamicode.com
首页 > 其他好文 > 详细

ActionFilterAttribute OnActionExecuting 获取参数

时间:2015-08-20 20:32:18      阅读:651      评论:0      收藏:0      [点我收藏+]

标签:

    public class AuthFilterAttribute : ActionFilterAttribute
    {
        /// <summary>
        /// Action执行前处理
        /// </summary>
        /// <param name="actionContext"></param>
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            HttpContextBase context = (HttpContextBase)actionContext.Request.Properties["MS_HttpContext"];//获取传统context
            HttpRequestBase request = context.Request;//定义传统request对象
            string name = request.Params["name"];
            
            base.OnActionExecuting(actionContext);
        }

        
    }

 

ActionFilterAttribute OnActionExecuting 获取参数

标签:

原文地址:http://www.cnblogs.com/niaowo/p/4746024.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!