public void DownloadDCETEmplateJson(String virtualPath) { DCEOperations dceOps = new DCEOperations(); DCE_Templates template = dceOps.GetTemplateByVirtualPath(virtualPath); DCETemplateKeywordsInJson retJson = new DCETemplateKeywordsInJson(); if (template != null) { retJson.DocType = template.DocumentType; List <DCEKeysList> dceKeysList = new List <DCEKeysList>(); foreach (InputtedKeyword keyword in GetKeywordsByVirtualPath(virtualPath)) { dceKeysList.Add(new DCEKeysList { Keyword = keyword.Keyword, Rank = keyword.Rank }); retJson.Score += keyword.Rank; } retJson.KeysList = dceKeysList; } HttpContext httpContext = this.HttpContext.ApplicationInstance.Context; UtilityOperations.DownloadJson(JsonConvert.SerializeObject(retJson), template.DocumentType, httpContext); }