string GetVirtualPath(ControllerContext controllerContext) { string controllerName = controllerContext.GetControllerName(); string actionName = controllerContext.GetActionName(); string areaName = controllerContext.GetAreaName(); string path = VirtualPath; if (string.IsNullOrEmpty(areaName)) { path = path.Replace("{area}", ""); } else { path = path.Replace("{area}", areaName + "/"); } path = path.Replace("{controller}", controllerName); path = path.Replace("{action}", actionName); path += ".____html"; //return path; return System.Web.Hosting.HostingEnvironment.MapPath(path).ToLower(); }