473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Handling errors and not redirecting to a custom error page

I think the answer is no, but I wanted to ask to be sure. Is it possible to
handle an exception in Page_Error or Application_Error and not redirect to a
custom error page? In other words I want the user to stay on the web page
and have the exception message shown on the page instead of redirecting to
another web page, the reason for this is that I don't want the user to lose
any information they might have typed into any controls on the page.

--
Jorge Matos
Bennett Adelson
Microsoft Solution Center
6050 Oak Tree Blvd. Suite 150
Cleveland, Ohio 44131
216.369.0140 ext. 117
www.bennettadelson.com

Nov 18 '05 #1
2 1349
Application_Error, is too late to redirect them anywhere. You would have to
have some setting in web.config to do this.

Page_Error, you can do whatever you want, including displaying an error
mesage to the user on the current page.

"Jorge Matos" <Jo********@discussions.microsoft.com> wrote in message
news:B7**********************************@microsof t.com...
I think the answer is no, but I wanted to ask to be sure. Is it possible to handle an exception in Page_Error or Application_Error and not redirect to a custom error page? In other words I want the user to stay on the web page
and have the exception message shown on the page instead of redirecting to
another web page, the reason for this is that I don't want the user to lose any information they might have typed into any controls on the page.

--
Jorge Matos
Bennett Adelson
Microsoft Solution Center
6050 Oak Tree Blvd. Suite 150
Cleveland, Ohio 44131
216.369.0140 ext. 117
www.bennettadelson.com

Nov 18 '05 #2
Hello Jorge,

You can handle Page_Error and do what you need to... Just remember to do
Server.ClearError() so that you dont continue bubbling your error up...

--
Matt Berther
http://www.mattberther.com
I think the answer is no, but I wanted to ask to be sure. Is it
possible to handle an exception in Page_Error or Application_Error
and not redirect to a custom error page? In other words I want the
user to stay on the web page and have the exception message shown on
the page instead of redirecting to another web page, the reason for
this is that I don't want the user to lose any information they might
have typed into any controls on the page.

Nov 18 '05 #3

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

Similar topics

8
by: Niraj Khandwala | last post by:
Dear all, this error handling has been a pain since so manya days using ASP 3.0 with IIS 5.0 on W2K server Created a custom error page using the Server.GetLastError() and works fine in most of...
2
by: Rajeev Soni | last post by:
Hi, Considering the scenario for handling exceptions in Web Application where we have Presentation layer, Business layer and Data Access layer; if there any exception is occurred in DAL, what is...
14
by: Al Smith | last post by:
I need help in implementing proper error handling. I am trying to upload a file based on the sample code below. The code works well except if the file selected is too big. I do know about the...
2
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...
4
by: Paul | last post by:
I have written a custom dll that I put inside the /bin directory of a production IIS server. Inside the config file of the web application i have added the following setting: <httpModules>...
3
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...
2
by: tshad | last post by:
This has been driving me crazy. I have been trying to get the error handling working on my system and can get parts of it working and others won't work at all. I found that you can't access...
7
by: Jason Kester | last post by:
Best I can tell, there are three basic ways you can deal with global error handling in ASP.NET. Namely: 1. Derive all your pages from a custom Page class, and override OnError() 2. Specify a...
3
by: hardieca | last post by:
Hi, I've created an n-tier app where validation rules reside in the business layer. When a webform is saved, a business object examines its state, and if some property is invalid, throws a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.