Any ideas for troubleshooting below?
There is an excellent TransferResult implementation here that works great on MVC 1.2 but doesn't work on MVC 3 RC.
public class TransferResult : RedirectResult { public TransferResult(string url): base(url) { } public override void ExecuteResult(ControllerContext context) { var httpContext = HttpContext.Current; httpContext.RewritePath(Url, false); IHttpHandler httpHandler = new MvcHttpHandler(); httpHandler.ProcessRequest(HttpContext.Current); } }
In MVC 3 RC, HTTPHandler.ProcessRequest fails and says 'HttpContext.SetSessionStateBehavior' can only be invoked before 'HttpApplication.AcquireRequestState' event is raised.
How to rewrite this code to do this?
UPD . The code works if it is running on the VS 2010 embedded development server, but does not work on the local IIS 7.5 host. The problem is still not resolved.
UPD2 This answer contains a modified TransferResult implementation that works with MVC3. It turns out it's even easier than before.
Andy
source share