private GetTemplateValue ( string path ) : System.Web.Mvc.JsonResult | ||
path | string | |
return | System.Web.Mvc.JsonResult |
public JsonResult GetTemplateValue(string path)
{
if (System.IO.File.Exists(Server.MapPath(path)))
{
var content = System.IO.File.ReadAllText(Server.MapPath(path), Encoding.UTF8);
return Json(new { success = true, content = content });
}
else
{
return Json(new { success = false, message = "Template with this name does not exist" });
}
}