예제 #1
0
 public ActionResult NewPage(Page page)
 {
     if (ModelState.IsValid)
     {
         TratarPagina(page);
         _repository.SavePage(page);
         return RedirectToAction("Pages");
     }
     return View(page);
 }
예제 #2
0
 private static void TratarPagina(Page page)
 {
     if (!page.Path.StartsWith("/"))
     {
         page.Path = "/" + page.Path;
     }
     if (page.ShowInMenu)
         page.Visible = true;
     page.Path = page.Path.Trim().Replace(" ", "-");
     page.Body = HttpUtility.HtmlDecode(page.Body);
 }