Ejemplo n.º 1
0
        protected override IContent WritePage(ISource source, IPageData pageData, OutputData outputData)
        {
            IContent content = base.WritePage(source, pageData, outputData);
            string   param   = pageData.QueryString["jsonpcallback"].Value <string>("jsonpcallback");
            string   text    = string.Format(ObjectUtil.SysCulture, "{0}({1})", param, content.Content);
            IContent result  = new SimpleContent(NetUtil.GetContentType(".js"), text, content.ContentEncoding);

            return(result);
        }
Ejemplo n.º 2
0
        public IContent WritePage(ISource source, IPageData pageData, OutputData outputData)
        {
            string text;

            try
            {
                text = File.ReadAllText(FileName, FileEncoding);
            }
            catch
            {
                text = string.Empty;
            }
            IContent content = new SimpleContent(ContentType, text, Encoding);

            return(content);
        }