public ActionResult AddPage(PageVM pagevm)
        {
            if (!ModelState.IsValid)
            {
                return(View(pagevm));
            }

            Page page = new Page();

            page.Title      = pagevm.Title;
            page.Slug       = pagevm.Slug;
            page.Body       = pagevm.Body;
            page.hasSidebar = pagevm.hasSidebar;
            page.Sorting    = AppConstants.SlugMax;

            var result = _pagesService.CreatePage(page);

            if (result != string.Empty)
            {
                ModelState.AddModelError("TitleExists", "Page or title already exists");
                return(View(pagevm));
            }
            else
            {
                TempData["SM"] = "Added page";
                return(this.RedirectToAction <PagesController>(x => x.Index()));
            }
        }