コード例 #1
0
        public IContent WritePage(ISource source, IPageData pageData, OutputData outputData)
        {
            ExceptionSource exSource = source.Convert <ExceptionSource>();
            string          fileName = exSource.FileName;
            object          result;

            if (string.IsNullOrEmpty(fileName))
            {
                result = new WebErrorResult(exSource.Data.Exception.Message);
            }
            else
            {
                fileName = Path.GetFileNameWithoutExtension(fileName);
                string url = AppUtil.ResolveUrl("~/c/plugin/C/Exception?FileName=" + fileName);
                result = new WebExceptionResult(url);
            }
            string json = result.WriteJson();

            return(new SimpleContent(ContentTypeConst.JSON, json));
        }