C# ASP on error try again?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have code in my global asax file that captures any runtime error the may
occur. It logs the error into a database table or emails the error to the
administrator. All is cool and works well

But there are some errors like SQL timeouts or transport-level errors for
which its usually just a slight hiccup in the communication between servers.
I can easily check for which types of errors these are but:

Is there a way I can tell code in the global.asax to go back and TRY the
last command again without having to reload the entire page? I know I can do
this at the page level by putting a try/catch in the catch block, but how can
I do this from global asax?
 
JP said:
I have code in my global asax file that captures any runtime error the may
occur. It logs the error into a database table or emails the error to the
administrator. All is cool and works well

But there are some errors like SQL timeouts or transport-level errors for
which its usually just a slight hiccup in the communication between
servers.
I can easily check for which types of errors these are but:

Is there a way I can tell code in the global.asax to go back and TRY the
last command again without having to reload the entire page? I know I can
do
this at the page level by putting a try/catch in the catch block, but how
can
I do this from global asax?

I don't think it's a good approach to be trying to do some kind of error
correction re-try like this in an ASP.Net solution. If you have a problem on
a page, then you need to deal with it on the page or redirect to another
page and deal with it, possibly restarting the page in error.
 
Back
Top