public ActionResult CustomCss(bool enableCustomCss, string content) { try { CurrentSite.EnsureCustomCss(); var path = HttpContext.Server.MapPath(CurrentSite.GetCustomCssPath()); using (var writer = new StreamWriter(path)) { writer.Write(content); } CurrentSite.EnableCustomCss = enableCustomCss; SaveChanges(); ShowSuccess(MessageResource.UpdateSuccess); } catch { ShowError(MessageResource.UpdateFailed); } ViewBag.Content = content; ViewBag.EnableCustomCss = enableCustomCss; return(View()); }
public ActionResult CustomCss() { CurrentSite.EnsureCustomCss(); var path = HttpContext.Server.MapPath(CurrentSite.GetCustomCssPath()); using (var reader = new StreamReader(path)) { ViewBag.Content = reader.ReadToEnd(); } ViewBag.EnableCustomCss = CurrentSite.EnableCustomCss; return(View()); }