handler, using context.Server.Transfer

J

John Murray

Am porting ASP.NET code from 2.0 beta 2 to the RTM for 2.0. In a
handler, I am doing a simple Transfer (with the code below) which
results in a NullReferenceException (stack trace below as well.)

As this was previously working, I have to assume that something has
change in the HttpServerUtility ... is anyone else having this problem,
and if so, what did you do to work around it?


Original Code:
================
public void ProcessRequest(HttpContext context)
{
context.Server.Transfer("~/Default.aspx", false);
}



Stack Trace
============
[NullReferenceException: Object reference not set to an instance of an
object.]
System.Web.HttpServerUtility.Execute(String path, TextWriter writer,
Boolean preserveForm) +229
System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm) +53
Shadows.Handlers.HomeTransferHandler.ProcessRequest(HttpContext
context) in
c:\pluck\shadows\trunk\website\shadows\App_Code\Handlers\HomeTransferHandler.cs:22

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+317
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +65
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top