user control behavior

Results 1 to 2 of 2

Thread: user control behavior

  1. #1
    Join Date
    Dec 1969

    Default user control behavior

    I have a page with a user control. I have chose to let unhandled System.Exceptions be handled at the Application level via the global.asax via Application_Error event. In the Application_Error event I have coded Server.Transfer("error.aspx"). Now can someone tell me why in the world when an unhandled exception occurs inside the user control, the content of the user control is being substituted with the content of the error.aspx? My expectation was to see error.aspx content alone.<BR><BR>Thanks for your help.<BR>Robby

  2. #2
    Join Date
    Dec 1969

    Default RE: user control behavior

    Server.Transfer replaces the currently executing item with the item being transferend to, so the behavior you are seeing makes sense. (right?)<BR><BR>If you want to show your custom error page I think that using response.redirect() would be an answer, but the better way would be to setup CustomError section in the Web.Config file. In there you can specify which page to redirect to on an unhandled exception.

Posting Permissions

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