private DeleteTemplate ( string path, string controlType ) : System.Web.Mvc.JsonResult | ||
path | string | |
controlType | string | |
return | System.Web.Mvc.JsonResult |
public JsonResult DeleteTemplate(string path, string controlType)
{
if (System.IO.File.Exists(Server.MapPath(path)))
{
System.IO.File.Delete(Server.MapPath(path));
var templates = CanvasHelper.GetTemplates(controlType);
return Json(new { success = true, templates = templates });
}
else
{
return Json(new { success = false, message = "Template file not found" });
}
}