Esempio n. 1
0
        public ActionResult CodeScript()
        {
            var path = Server.MapPath("~/scripts/custom.js");

            var code = System.IO.File.ReadAllText(path);

            var model = new TextFileModel()
            {
                Text = code
            };

            return View(model);
        }
Esempio n. 2
0
        public ActionResult CodeScriptUpdate(TextFileModel model)
        {
            var path = Server.MapPath("~/scripts/custom.js");

            var text = string.IsNullOrEmpty(model.Text) ? string.Empty : model.Text.Trim();
            System.IO.File.WriteAllText(path, text);

            return RedirectToAction("CodeScript");
        }
Esempio n. 3
0
        public ActionResult CodeStyle()
        {
            var path = Server.MapPath("~/content/custom.css");

            var code = System.IO.File.ReadAllText(path);

            var model = new TextFileModel()
            {
                Text = code
            };

            return View(model);
        }