Passing errors - not in the url

R

Rob MacFadyen

David,

You can use "Exception ex = Server.GetLastError();" to get the last error
(typically the one that caused your error page to occur).

Btw... I personally dislike redirecting to an error page (from a user
perspective I like being able to click Refresh to try the operation again).
You might want to look into using an HttpModule for handling errors (much
easier in ASP.NET 2.0 than 1.x).

Regards,

Rob MacFadyen
 
W

Walter Wang [MSFT]

Hi David,

You can refer to following MSDN library for more information:

#How to: Handle Application-Level Errors
http://msdn2.microsoft.com/en-us/library/24395wz3.aspx

Normally you use Server.GetLastError() in your error page's Page_Load to
get the unhandled exception.

I hope this helps. Please feel free to post here if anything is unclear.

Sincerely,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top