public static String Js(String files, Boolean debug) { String name = HelperService.CalculateMD5Hash(files); String path = @"/cache/script/js/"; String FilePath = path + name + ".js"; if (!HelperService.DirExists(path)) { System.IO.Directory.CreateDirectory(path); } JavaScriptBundle js = new JavaScriptBundle(); foreach (string fl in files.Split(',')) { if (File.Exists(HttpContext.Current.Server.MapPath(fl))) { js.Add(fl); } } if (debug == true) { return(js.ForceRelease().ForceDebug().Render(FilePath)); } else { return(js.ForceRelease().Render(FilePath)); } }
public static String Js(string files) { String name = CalculateMD5Hash(files); String path = @"/cache/script/js/"; String FilePath = path + name + ".js"; if (!HelperService.DirExists(path)) { System.IO.Directory.CreateDirectory(path); } JavaScriptBundle js = new JavaScriptBundle(); foreach (string fl in files.Split(',')) { js.Add(fl); } return(js.ForceRelease().Render(FilePath)); }