コード例 #1
0
ファイル: HandleErrorAttribute.cs プロジェクト: UHgEHEP/test
		private void HandleErrorImpl(ExceptionContext filterContext, string uid)
		{
			var controllerName = (string)filterContext.RouteData.Values["controller"];
			var actionName = (string)filterContext.RouteData.Values["action"];
			var model = new CustomHandleErrorInfo(filterContext.Exception, controllerName, actionName, uid);
			filterContext.Result = new ViewResult
			{
				ViewName = View,
				MasterName = Master,
				ViewData = new ViewDataDictionary<CustomHandleErrorInfo>(model),
				TempData = filterContext.Controller.TempData
			};
			filterContext.ExceptionHandled = true;
			filterContext.HttpContext.Response.Clear();
			filterContext.HttpContext.Response.TrySkipIisCustomErrors = true;
		}
コード例 #2
0
        private void HandleErrorImpl(ExceptionContext filterContext, string uid)
        {
            var controllerName = (string)filterContext.RouteData.Values["controller"];
            var actionName     = (string)filterContext.RouteData.Values["action"];
            var model          = new CustomHandleErrorInfo(filterContext.Exception, controllerName, actionName, uid);

            filterContext.Result = new ViewResult
            {
                ViewName   = View,
                MasterName = Master,
                ViewData   = new ViewDataDictionary <CustomHandleErrorInfo>(model),
                TempData   = filterContext.Controller.TempData
            };
            filterContext.ExceptionHandled = true;
            filterContext.HttpContext.Response.Clear();
            filterContext.HttpContext.Response.TrySkipIisCustomErrors = true;
        }