Пример #1
0
        public ActionResult Index(string language, string category, string id)
        {
            PageModel model = new PageModel(this.HttpContext);

            string viewName = string.Format(
                "~/content/{0}/{1}/{2}/index.cshtml",
                language,
                category,
                id
            );

            return View(viewName, model);
        }
Пример #2
0
        public ActionResult Image(string language, string category, string id, string image)
        {
            PageModel model = new PageModel(this.HttpContext);

            string path = string.Format(
                "~/content/{0}/{1}/{2}/{3}",
                language,
                category,
                id,
                image
            );

            return this.File(path, MimeMapping.GetMimeMapping(path));
        }
Пример #3
0
        public ActionResult Image(string language, string id, string image)
        {
            PageModel model = new PageModel(this.HttpContext);
            Match match = REGEX_POST.Match(id);
            if (match.Success)
            {
                string path = string.Format(
                    "~/content/blog/{0}/{1}/{2}/{3}",
                    match.Result("${year}"),
                    match.Result("${month}"),
                    match.Result("${day}"),
                    image
                );

                return this.File(path, MimeMapping.GetMimeMapping(path));
            }
            else
            {
                return this.HttpNotFound();
            }
        }
Пример #4
0
        public ActionResult Post(string language, string id)
        {
            PageModel model = new PageModel(this.HttpContext);
            Match match = REGEX_POST.Match(id);
            if (match.Success)
            {
                string viewName = string.Format(
                    "~/content/blog/{0}/{1}/{2}/{3}.{4}.cshtml",
                    match.Result("${year}"),
                    match.Result("${month}"),
                    match.Result("${day}"),
                    language,
                    match.Result("${id}")
                );

                return View(viewName, model);
            }
            else
            {
                return this.HttpNotFound();
            }
        }
Пример #5
0
 public ActionResult Index()
 {
     PageModel model = new PageModel(this.HttpContext);
     return View("Index", model);
 }