Пример #1
0
        public ActionResult Index(string FriendlyUrl)
        {
            if (string.IsNullOrEmpty(FriendlyUrl))
            {
                if (!string.IsNullOrEmpty(APP._CurrentFriendlyUrl))
                {
                    return(Redirect("/" + APP._CurrentFriendlyUrl));
                }
            }
            var _Model = PageService.Get(FriendlyUrl, APP._SiteID, Request.Url.Authority);

            if (_Model == null)
            {
                throw new HttpException(404, "Page Not Found");
            }
            else
            {
                if (!string.IsNullOrEmpty(_Model.Page.RedirectUrl))
                {
                    return(Redirect(_Model.Page.RedirectUrl));
                }

                ViewBag.Title           = _Model.Page.TitlePage;
                ViewBag.MetaDescription = _Model.Page.MetaDescription;
                ViewBag.Active          = "page-" + FriendlyUrl;

                ViewBag.OGraph = _Model.Page.OGraph;

                APP._CurrentLang = _Model.Page.CultureName;
                return(View(_Model.Page.ViewRender, _Model));
            }
        }
Пример #2
0
 public IHttpActionResult Get(int SiteID)
 {
     return(Ok(_PageService.Get(SiteID, User.Identity.GetUserId())));
 }