473,698 Members | 2,508 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

one custom error page that handles all exceptions

I want to have a custom error page that I can always call
and pass parameters to it when I hit runtime exceptions.
For instance, in my code behind, I have a try-catch block.
When I catch an exception, the exception object contains a
collection of messages to be displaied. I would like to be
able to call a common exception handling page and somehow
pass along the exception collection. Then the exception
page will retrive the messages from the collection and
display it to the user's browser.

Could someone tell me how to achieve this? Some sample
code would be even better.

Thanks a million.

Feng
Nov 18 '05 #1
1 1020
Just an idea but.....
throw it (the error) to a session item, then in your webconfig specify the
page, in the customErrors tag, and have this page look in the session for a
value?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"feng" <an*******@disc ussions.microso ft.com> wrote in message
news:14******** *************** *****@phx.gbl.. .
I want to have a custom error page that I can always call
and pass parameters to it when I hit runtime exceptions.
For instance, in my code behind, I have a try-catch block.
When I catch an exception, the exception object contains a
collection of messages to be displaied. I would like to be
able to call a common exception handling page and somehow
pass along the exception collection. Then the exception
page will retrive the messages from the collection and
display it to the user's browser.

Could someone tell me how to achieve this? Some sample
code would be even better.

Thanks a million.

Feng

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1234
by: Chua Wen Ching | last post by:
Hi there, I had been wondering for a while. I am building a very efficient Custom Exception Library. But i wasn't that sure whether i should be using XML or not. There are 3 ways which i thought off. 1) The tradional way, how my office people handles exception in C language. Exceptions are stored in enum
2
2538
by: Matt | last post by:
Hello all, The app we are working on uses custom errors extensively to provide friendly error pages to users whilst logging the actual exceptions behind the scenes. However.... We are now having to integrate some Web services into the application using the existing architecture. These Web services are secured using Forms Authentication. Hence, we need to turn the default behavior of Forms Authentication (redirects to login pages, etc)...
11
1625
by: George | last post by:
Everytime when I redirect from one particular page to another, it will raise 4 exceptions, before Page_Load routine runs. I can't figure out a way to find out what are the exceptions. When I use Application Center Test, number of Http errors rises with the number of requests, so I suspect those are Http exceptions. The worst part is that, when total number of exceptions accumulated to certain extent, it seems to cause messive...
0
1664
by: Rhys666 | last post by:
OK, an issue I've come across before, but never found a cause for or resolution of, has decided to become the bane of my life again with ASP.Net Custom Error Pages. Basically, my web application is configured to utilise a custom errors page, in that unhandled exceptions get passed through and the page redirects correctly as per the settings in the web.config file and Global.asax. This works in 95% or so of cases, however... On...
1
1148
by: Tom Conlon | last post by:
I have a classic problem, "asp.net app works fine on my PC with local IIS" but when i deploy to my web host (where i am a customer, not an admin), it doesn't work. So, boo-hoo, can't use VS debugging on server, and error details are not given by asp.net on its standard error page anymore. I understand i can define a custom error page, but do not see how to write the information i want to that page. Do you write to a file on the server,...
3
2055
by: Mr Newbie | last post by:
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 -----------
15
2713
by: bill salkin | last post by:
I'd like to create a custom error handler like this in VB.NET: .... try ... Throw ("Lender Name not in table") .... catch ("Lender Name not in table")
3
3403
by: matko | last post by:
This is a long one, so I'll summarize: 1. What are your opinions on raising an exception within the constructor of a (custom) exception? 2. How do -you- validate arguments in your own exception constructors? I've noticed that, f.ex., ArgumentException accepts null arguments without raising ArgumentNullException. Obviously, if nothing is to be supplied to the exception constructor, the default constructor should
35
3780
by: jeffc226 | last post by:
I'm interested in an idiom for handling errors in functions without using traditional nested ifs, because I think that can be very awkward and difficult to maintain, when the number of error checks gets about 3 or so. It also gets very awkward in nested loops, where you want to check for normal loop processing in the loop condition, not errors. Yes, you could put some generic exit flag in the loop condition, but when you're simply done if...
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7743
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.