Previous Thread:   IIS getting directory paths incorrect

9/30/2005 3:39:31 PM    Re: Custom Error Handling Problem /Question
You might want to download and check out the source code for  
  
the "Error Handling in ASP.NET" Code Project article By Rakesh Rajan.  
  
It shows how to manage several error handling configurations.  
  
http://www.codeproject.com/aspnet/ErrorHandlingASPNET.asp  
  
You will need to become a member ( free ) of the Code Project  
  
to be able to download any source code files from it, but they are  
  
good about not hassling you or sending spam.  
  
You can read the article without having to become a member, though.  
  
Off hand :  
  
1. Did you set up error handling in web.config and global.asax ?  
  
web.config :  
  
<customErrors mode="On" defaultRedirect="ErrDefault.aspx"/>  
  
global.asax :  
  
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)  
  
Server.Transfer("ErrDefault.aspx")  
  
End Sub  
  
2. What does "ErrDefault.aspx" do ?  
  
I have web.config and global.asax setup that way,  
  
and you can see the test page with your code, working OK, at :  
  
http://asp.net.do/test/errorTest.aspx  
  
Juan T. Llibre, ASP.NET MVP  
  
ASP.NET FAQ : http://asp.net.do/faq/  
  
Foros de ASP.NET en EspaƱol : http://asp.net.do/foros/  
  
======================================  
  
"Mr Newbie" <here@now.com> wrote in message news:uboXdJdxFHA.612@TK2MSFTNGP10.phx.gbl...



9/30/2005 4:19:27 PM    Custom Error Handling Problem /Question
I'm testing error handling configurations and having some trouble. I created  
  
a WebForm called.  ErrDefault.aspx and I am trying to use the Page error  
  
attribute to force the redirection to a custom page, but I only get and  
  
unhandled exception page and it does not direct me to my specific page. I'm  
  
probably doing something really stupid, but I cant see what .  
  
Any Ideas ?  - Thanx Mr N  
  
---------  DETAILS BELOW -----------  
  
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"  
  
Inherits="Exceptions1.WebForm1" errorPage="ErrDefault.aspx"%>  
  
In my button handler.  
  
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As  
  
System.EventArgs) Handles Button1.Click  
  
Throw New System.Net.WebException("Custom Error Page")  
  
End Sub  
  
Custom Error Page  
  
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.Net.WebException: Custom Error Page  
  
Source Error:  
  
Line 33:  
  
Line 34:     Private Sub Button1_Click(ByVal sender As System.Object, ByVal  
  
e As System.EventArgs) Handles Button1.Click  
  
Line 35:         Throw New System.Net.WebException("Custom Error Page")  
  
Line 36:     End Sub  
  
Line 37: End Class

9/30/2005 11:17:59 PM    Re: Custom Error Handling Problem /Question
Thanks Jaun  
  
I'll take a look tomorrow, its late right now and my brain has ceased  
  
virtually all non automatic function.  
  
Regards - Mr N  
  
"Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message  
  
news:%23VZbzafxFHA.1256@TK2MSFTNGP09.phx.gbl...

10/1/2005 11:58:02 AM    Re: Custom Error Handling Problem /Question
Yes, that was it, I forgot to set the custom error section in the  
  
web.config, I knew it would be something really stupidly fundamental, and of  
  
course obvious to anyone else but myself.  
  
;-D  
  
Cheers Mr N.  
  
"Mr Newbie" <here@now.com> wrote in message  
  
news:usHQVzgxFHA.900@TK2MSFTNGP11.phx.gbl...