Handling errors and not redirecting to a custom error page

G

Guest

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
 
M

Marina

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.
 
M

Matt Berther

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...
 

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,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top