コード例 #1
0
        public ActionResult InvokeSimpleErrorHandler(string resource, string subResource)
        {
            using (var writer = new StringWriter())
            {
                var response = new HttpResponse(writer);
                var context = new HttpContext(System.Web.HttpContext.Current.Request, response);
                var factory = new SimpleErrorHandler.ErrorLogPageFactory();

                var page = factory.GetHandler(context, Request.RequestType, Request.Url.ToString(), Request.PathInfo);
                page.ProcessRequest(context);

                return Content(writer.ToString());
            }
        }
コード例 #2
0
        public ActionResult InvokeSimpleErrorHandler(string resource, string subResource)
        {
            using (var writer = new StringWriter())
            {
                var response = new HttpResponse(writer);
                var context  = new HttpContext(System.Web.HttpContext.Current.Request, response);
                var factory  = new SimpleErrorHandler.ErrorLogPageFactory();

                var page = factory.GetHandler(context, Request.RequestType, Request.Url.ToString(), Request.PathInfo);
                page.ProcessRequest(context);

                return(Content(writer.ToString()));
            }
        }