public JsonResult GetSiteTaskInventoryAttachments(string Filter, long SiteTaskInventoryId) { PM_TaskEntryBL te = new PM_TaskEntryBL(); List <PM_SiteTaskInventoryAttachments> list = te.Get_SiteTask_Inventory_Attachments(Filter, SiteTaskInventoryId); foreach (var item in list) { SWI.AirView.Common.WebConfig wc = new SWI.AirView.Common.WebConfig(); var SiteTaskInventoryPath = wc.AppSettings("SiteTaskInventoryPath"); string host = Request.Url.Authority; string connectionType = Request.Url.Scheme; var path = Path.Combine(connectionType + "://" + host + "/" + SiteTaskInventoryPath + "/" + item.SiteTaskInventoryId); item.SubDirectory = path; } return(Json(list, JsonRequestBehavior.AllowGet)); }