re:
> what is the point in this if I still need to write code to
> do it in the Application_Error method?
> Examples i've seen from Microsoft did not elude to having to do that.
Hi, Demetri.
No offense, but you need to get your hands dirty with exception handling.
There's a lot more to this than you think there is.
There's plain Exceptions and there's Unhandled Exceptions.
They're handled via different methods.
Check out Peter Bromberg's excellent article on Unhandled Exceptions :
http://www.eggheadcafe.com/articles/20060305.asp
Also, check out this KB :
http://support.microsoft.com/?id=911816
....and, for good measure, see this Code Project article :
http://www.codeproject.com/aspnet/AS...onHandling.asp
Juan T. Llibre, asp.net MVP
aspnetfaq.com :
http://www.aspnetfaq.com/
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
===================================
"Demetri" <(E-Mail Removed)> wrote in message
news:2281834A-C022-4818-8B31-(E-Mail Removed)...
> The Application_Error sub/void in global.asax has nothing. I didn't think it
> needed any code since the customErrors section has an attribute for the
> defaultRedirect, what is the point in this if I still need to write code to
> do it in the Application_Error method?
>
> Examples i've seen from Microsoft did not elude to having to do that.
>
> -Demetri
>
>
> "Juan T. Llibre" wrote:
>
>> re:
>> > Why the heck doesn't it direct to my Error.aspx page and show the error that way?
>>
>> Any unhandled exception is captured by Application_Error.
>>
>> What does your Application_Error sub/void in global.asax have ?
>>
>> You should have something like :
>>
>> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
>> Server.Transfer("Error.aspx")
>> End Sub
>>
>>
>>
>> Juan T. Llibre, asp.net MVP
>> aspnetfaq.com : http://www.aspnetfaq.com/
>> asp.net faq : http://asp.net.do/faq/
>> foros de asp.net, en español : http://asp.net.do/foros/
>> ===================================
>> "Demetri" <(E-Mail Removed)> wrote in message
>> news:A92CA73C-2AD6-4A65-A5B7-(E-Mail Removed)...
>> >I posted this question about a week or so ago. I never got any replies so
>> > please forgive me if you have already read this question.
>> >
>> > I have the following in my web config file:
>> >
>> > <customErrors mode="RemoteOnly" defaultRedirect="Error.aspx" />
>> >
>> > Here is the code in the Error.aspx:
>> >
>> > protected void Page_Load(object sender, EventArgs e)
>> > {
>> > Exception err = Server.GetLastError().GetBaseException();
>> >
>> > this.lblMessage.Text = err.ToString();
>> > }
>> >
>> > If mode is set to RemoteOnly I still get the yellow screen of death.
>> > If mode is set to Off I still get the yellow screen of death.
>> > If mode is set to On I get the yellow screen of death that tells me to set
>> > the mode to RemoteOnly or Off to see the actual error message.
>> >
>> > Why the heck doesn't it direct to my Error.aspx page and show the error that
>> > way?
>> >
>> >
>> > --
>> > -Demetri
>>
>>
>>