handler, using context.Server.Transfer

Discussion in 'ASP .Net' started by John Murray, Nov 8, 2005.

  1. John Murray

    John Murray Guest

    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
     
    John Murray, Nov 8, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. LJ Jurkovic

    Context.Items lost using Server.Transfer

    LJ Jurkovic, Apr 1, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    734
  2. VS_NET_DEV
    Replies:
    2
    Views:
    3,839
    jenny
    May 25, 2004
  3. aaa
    Replies:
    0
    Views:
    470
  4. segue
    Replies:
    0
    Views:
    594
    segue
    Mar 4, 2008
  5. Jim
    Replies:
    1
    Views:
    995
    Aaron Bertrand - MVP
    Jan 28, 2004
Loading...

Share This Page