From 9b78cb3f7cd8ee545481ad3a159110b907367127 Mon Sep 17 00:00:00 2001 From: mattbrailsford Date: Thu, 13 Jun 2013 09:26:45 +0100 Subject: [PATCH] Updated RenderMvcController to have the view engines test for file existance, rather than assuming views will always be razor. This allows alternative MVC view engines to be used. --- src/Umbraco.Web/Mvc/RenderMvcController.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web/Mvc/RenderMvcController.cs b/src/Umbraco.Web/Mvc/RenderMvcController.cs index 0f26610070..4615937e6b 100644 --- a/src/Umbraco.Web/Mvc/RenderMvcController.cs +++ b/src/Umbraco.Web/Mvc/RenderMvcController.cs @@ -73,13 +73,13 @@ namespace Umbraco.Web.Mvc /// protected bool EnsurePhsyicalViewExists(string template) { - if (!System.IO.File.Exists( - Path.Combine(Server.MapPath(Constants.ViewLocation), template + ".cshtml"))) - { - LogHelper.Warn("No physical template file was found for template " + template); - return false; - } - return true; + var result = ViewEngines.Engines.FindView(ControllerContext, template, null); + if(result.View == null) + { + LogHelper.Warn("No physical template file was found for template " + template); + return false; + } + return true; } ///