Professional Web Applications Themes

context.Server.Transfer - ASP.NET General

Hi! Im using a custom handler with an ASP.NET application using the Front Controller pattern. But Im experiementing some problems with the following line of code: context.Server.Transfer(url); context is a HttpContext object and url is a string with the target url. When running the application, I obtain the following error: Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code Exception Details: System.Web.HttpException: Error executing child request for /logon.aspx what can be the error????...

  1. #1

    Default context.Server.Transfer

    Hi!

    Im using a custom handler with an ASP.NET application
    using the Front Controller pattern.

    But Im experiementing some problems with the following
    line of code:

    context.Server.Transfer(url);

    context is a HttpContext object and url is a string with
    the target url.

    When running the application, I obtain the following
    error:

    Description: An unhandled exception occurred during the
    execution of the current web request. Please review the
    stack trace for more information about the error and
    where it originated in the code

    Exception Details: System.Web.HttpException: Error
    executing child request for /logon.aspx


    what can be the error????
    Mauricio Guest

  2. #2

    Default Re: context.Server.Transfer

    Try

    System.Web.HttpContext.Current.Server.Transfer(url );

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.

    "Mauricio" <com> wrote in message
    news:020d01c368e6$a9d39b50$gbl...
    Hi!

    Im using a custom handler with an ASP.NET application
    using the Front Controller pattern.

    But Im experiementing some problems with the following
    line of code:

    context.Server.Transfer(url);

    context is a HttpContext object and url is a string with
    the target url.

    When running the application, I obtain the following
    error:

    Description: An unhandled exception occurred during the
    execution of the current web request. Please review the
    stack trace for more information about the error and
    where it originated in the code

    Exception Details: System.Web.HttpException: Error
    executing child request for /logon.aspx


    what can be the error????


    Kevin Guest

  3. #3

    Default Re: context.Server.Transfer

    It doesnt work. I have the same error.

    Description: An unhandled exception occurred during the
    execution of the current web request. Please review the
    stack trace for more information about the error and
    where it originated in the code.

    Exception Details: System.Web.HttpException: Error
    executing child request for default.aspx.

    Source Error:


    Line 22:
    Line 23: // context.Server.Transfer
    (url);
    Line 24:
    System.Web.HttpContext.Current.Server.Transfer
    (url);
    Line 25: }
    Line 26: }

    Stack Trace:


    [HttpException (0x80004005): Error executing child
    request for default.aspx.]
    System.Web.HttpServerUtility.ExecuteInternal(Strin g
    path, TextWriter writer, Boolean preserveForm)
    System.Web.HttpServerUtility.Transfer(String path,
    Boolean preserveForm)
    System.Web.HttpServerUtility.Transfer(String path)
    Volvo.Evaluacion.Web.RedirectingCommand.Execute
    (HttpContext context) in
    c:\inetpub\wwwroot\volvoeval\redirectingcommand.cs :24
    Volvo.Evaluacion.Web.Handler.ProcessRequest
    (HttpContext context) in
    c:\inetpub\wwwroot\volvoeval\handler.cs:14

    System.Web.CallHandlerExecutionStep.System.Web.Htt pApplica
    tion+IExecutionStep.Execute()
    System.Web.HttpApplication.ExecuteStep(IExecutionS tep
    step, Boolean& completedSynchronously)


    Version Information: Microsoft .NET Framework
    Version:1.1.4322.557; ASP.NET Version:1.1.4322.557


    Mauricio Guest

  4. #4

    Default Re: Context.Server.Transfer

    Did this (below) work it was given to you by Kevin if I am not mistaken

    System.Web.HttpContext.Current.Server.Transfer(url );



    "Mauricio" <com> wrote in message
    news:0b5d01c36b1f$610399d0$gbl...
    Hi!

    Im using a custom handler with an ASP.NET application
    using the Front Controller pattern.

    But Im experiementing some problems with the following
    line of code:

    context.Server.Transfer(url);

    context is a HttpContext object and url is a string with
    the target url.

    When running the application, I obtain the following
    error:

    Description: An unhandled exception occurred during the
    execution of the current web request. Please review the
    stack trace for more information about the error and
    where it originated in the code.

    Exception Details: System.Web.HttpException: Error
    executing child request for default.aspx.

    Source Error:


    Line 22:
    Line 23: // context.Server.Transfer
    (url);
    Line 24:
    System.Web.HttpContext.Current.Server.Transfer
    (url);
    Line 25: }
    Line 26: }

    Stack Trace:


    [HttpException (0x80004005): Error executing child
    request for default.aspx.]
    System.Web.HttpServerUtility.ExecuteInternal(Strin g
    path, TextWriter writer, Boolean preserveForm)
    System.Web.HttpServerUtility.Transfer(String path,
    Boolean preserveForm)
    System.Web.HttpServerUtility.Transfer(String path)
    Volvo.Evaluacion.Web.RedirectingCommand.Execute
    (HttpContext context) in
    c:\inetpub\wwwroot\volvoeval\redirectingcommand.cs :24
    Volvo.Evaluacion.Web.Handler.ProcessRequest
    (HttpContext context) in
    c:\inetpub\wwwroot\volvoeval\handler.cs:14

    System.Web.CallHandlerExecutionStep.System.Web.Htt pApplica
    tion+IExecutionStep.Execute()
    System.Web.HttpApplication.ExecuteStep(IExecutionS tep
    step, Boolean& completedSynchronously)


    Version Information: Microsoft .NET Framework
    Version:1.1.4322.557; ASP.NET Version:1.1.4322.557


    MS Guest

  5. #5

    Default Re: Context.Server.Transfer

    It is the CURRENT HttpContext object....

    I tried:

    System.Web.HttpContext.Current.Server.Transfer(url );

    But I obtain the same error.
     
    HttpContext object, 

    Mauricio Guest

  6. #6

    Default Re: Context.Server.Transfer


    I tried:

    System.Web.HttpContext.Current.Server.Transfer(url );

    But I obtain the same error.

     
    am not mistaken 

    Mauricio Guest

  7. #7

    Default Re: Context.Server.Transfer

    Kevin,

    At what point in time does a request gets a context when using a custom
    ASP.NET handler?


    "Kevin Spencer" <com> wrote in message
    news:%phx.gbl... 


    MS Guest

  8. #8

    Default Re: Context.Server.Transfer

    Well, the error message you posted had several lines of code in it, and I
    noticed the following:

    Line 22:
    Line 23: // context.Server.Transfer(url);
    Line 24:
    System.Web.HttpContext.Current.Server.Transfer

    Note that there are 2 lines of code attempting to do the Transfer, and the
    SECOND is the one that uses the Current HttpContext.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.


    "Mauricio" <com> wrote in message
    news:0b7601c36b23$efb1f330$gbl...
    It is the CURRENT HttpContext object....

    I tried:

    System.Web.HttpContext.Current.Server.Transfer(url );

    But I obtain the same error.
     
    HttpContext object, 



    Kevin Guest

  9. #9

    Default Re: Context.Server.Transfer

    A Request doesn't get the Context (the Request object is part of the
    Context). The Handler does. It receives it from the server when it is
    invoked.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.

    "MS News (MS ILM)" <com> wrote in message
    news:phx.gbl... [/ref]
    object, 
    >
    >[/ref]


    Kevin Guest

  10. #10

    Default Re: Context.Server.Transfer

    Thank you for clearing this up


    "Kevin Spencer" <com> wrote in message
    news:phx.gbl... [/ref]
    > object, 
    > >
    > >[/ref]
    >
    >[/ref]


    MS Guest

  11. #11

    Default Re: Context.Server.Transfer

    Kevin,

    I am lost, it must be Monday or Mars is pulling too much on my brain.

    When he reaches the ASP.NET Handler I beleive you said he already has a
    context

    You said:
    "A Request doesn't get the Context (the Request object is part of the
    Context). The Handler does. It receives it from the server when it is
    invoked."

    Thank you




    "Kevin Spencer" <com> wrote in message
    news:%phx.gbl... [/ref][/ref]
    and [/ref]
    > the 
    > >
    > >[/ref]
    >
    >[/ref]


    MS Guest

  12. #12

    Default Re: Context.Server.Transfer

    That's true, unless he's using an assembly that isn't the Handler itself.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.

    "MS News (MS ILM)" <com> wrote in message
    news:phx.gbl... [/ref]
    exists? [/ref]
    > and [/ref][/ref]
    and 
    > >
    > >[/ref]
    >
    >[/ref]


    Kevin Guest

Similar Threads

  1. this.Context.Server.MapPath
    By crazyhorse in forum ASP.NET Building Controls
    Replies: 4
    Last Post: June 10th, 03:30 PM
  2. Error Server.Transfer / Server.Execute ()
    By Abdul Azeem in forum ASP Database
    Replies: 2
    Last Post: June 30th, 01:46 PM
  3. Replies: 1
    Last Post: September 9th, 04:44 PM
  4. Server.Transfer
    By Ali Nasir in forum ASP.NET General
    Replies: 4
    Last Post: August 26th, 05:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139