Ejemplo n.º 1
0
        public FileResult Image(int id)
        {
            var layout = _layoutService.Find(id);

            if (layout == null)
            {
                //there is no default page layout set
                return(null);
            }

            if (layout.Image == null)
            {
                var placeHolderPath = Server.MapPath("~/Core/assetsCms/images/imagePlaceHolder.jpg");
                return(File(System.IO.File.ReadAllBytes(placeHolderPath), "image/jpg"));
            }
            else
            {
                return(File(layout.Image, "image/png"));
            }
        }
Ejemplo n.º 2
0
        public ContentResult Styles(int id)
        {
            var layout = _layoutService.Find(id);

            if (layout == null)
            {
                //there is no default page layout set
                return(null);
            }

            return(Content(layout.Style, "text/css"));
        }