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.
This commit is contained in:
Shannon Deminick
2012-09-29 07:36:19 +07:00
parent 34e71027b3
commit b3ca264af1

View File

@@ -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;
}