English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

hi i wanted to know if anyone here has their own method of handeling errors on asp.net , were using c#. i setup the web.config file with these attributes
====================================





===========================================
now when i run the page i still get the error page that tells me to setup my web.config files error handling with the above code, i also tried setting it to on and the same thing happends.

also on other pages when i load it, i get errors like line 1: bla bla "=" something to do with an equal sign.

is there a way to trap these errros as much as possible and display a custom error page? instead of the ugly error page.
most of the errors i recieve are internal hard to understand errors.

thanks

2007-03-01 17:55:47 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

The easiest way is to simply wrap each page logic in a try/catch:

Page_Load()
{
try
{
//all your normal code goes here
}
catch
{
//code here will run if an error occurred in the try block
}
}

If you are looking for something a little more robust and sophisticated, I recommend exploring the Exception Handling application block of the Enterprise Library - http://msdn.microsoft.com/practices/guidetype/AppBlocks/

2007-03-01 18:05:00 · answer #1 · answered by Rex M 6 · 0 0

I observed a ecu the day earlier at present jogging down the line. i assume you think of there is an blunders there to boot. Isaac is the only one here who is conscious what he's speaking approximately. And specific, i complete a sentence with a preposition.

2016-12-18 03:57:42 · answer #2 · answered by binford 4 · 0 0

set that error mode="off"
and change in the global.aspx file to ur custom error file..

2007-03-01 18:07:35 · answer #3 · answered by jimmyparija 2 · 0 1

fedest.com, questions and answers