|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Passing errors - not in the urlHi;
When I get an undlanled exception and need to pass info (like the exception) to the error page - I don't want to pass that in the url. Is there a way to pass it so the user does not see it? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com Cubicle Wars - http://www.windwardreports.com/film.htm 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 Show quote "David Thielen" <thielen@nospam.nospam> wrote in message news:97AE2695-4831-46DA-B7EB-20C970574BED@microsoft.com... > Hi; > > When I get an undlanled exception and need to pass info (like the > exception) > to the error page - I don't want to pass that in the url. Is there a way > to > pass it so the user does not see it? > > -- > thanks - dave > david_at_windward_dot_net > http://www.windwardreports.com > > Cubicle Wars - http://www.windwardreports.com/film.htm > > 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 (waw***@online.microsoft.com, 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. |
|||||||||||||||||||||||