随笔分类 -  MVC

摘要:定义异常捕获类:[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMultiple = true)] public class ExceptionAttribute : FilterAttribute, IExceptionFilter { public virtual void OnException(ExceptionContext filterContext) { string message = s... 阅读全文
posted @ 2013-08-04 16:24 南阳·源 阅读(3847) 评论(1) 推荐(0) 编辑
摘要:定义过滤类:public class TestFilter : ActionFilterAttribute { /// /// 行为执行前 /// /// public override void OnActionExecuting(ActionExecutingContext filterContext) { //ToDoing if (filterContext.ActionDescriptor.ActionName.ToLower() == "tes... 阅读全文
posted @ 2012-02-03 16:17 南阳·源 阅读(343) 评论(0) 推荐(0) 编辑
摘要:在添加多个Area时,如添加:AreaTest ,需求修改AreaTestAreaRegistration.csView Code public class AreaTestAreaRegistration : AreaRegistration { public override string AreaName { get { return "AreaTest"; } } public override void RegisterArea... 阅读全文
posted @ 2012-02-03 16:07 南阳·源 阅读(1008) 评论(2) 推荐(0) 编辑

点击右上角即可分享
微信分享提示