From b3ca264af124eb1e200094b7d180a5cb62781597 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Sat, 29 Sep 2012 07:36:19 +0700 Subject: [PATCH] Explicitly loads webforms handler and remaps to it, now we can share this code somehow with the RenderRouteHandler when we want to support having a no-template render as a 404. --- src/Umbraco.Web/UmbracoModule.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index 95d1b2f2d6..47dfd233ed 100644 --- a/src/Umbraco.Web/UmbracoModule.cs +++ b/src/Umbraco.Web/UmbracoModule.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Web; +using System.Web.Compilation; using System.Web.Mvc; using System.Web.Routing; using System.Web.UI; @@ -397,6 +398,10 @@ namespace Umbraco.Web rewritePath = "~/default.aspx" + currentQuery; //First we rewrite the path to the path of the handler (i.e. default.aspx or /umbraco/RenderMvc ) context.RewritePath(rewritePath, "", currentQuery.TrimStart(new[] { '?' }), false); + + //now, execute the handler + var webFormshandler = (global::umbraco.UmbracoDefault)BuildManager.CreateInstanceFromVirtualPath("~/default.aspx", typeof(global::umbraco.UmbracoDefault)); + context.RemapHandler(webFormshandler); break; }