Pages

Wednesday, July 4, 2012

On Error Resume Next Asp Vbscript

On Error Resume next Asp

Error Handling using the on error resume next statement asp

The on Error resume next statement in code tells ASP to skip the error and execute the next line of code, instead of stopping the execution of the script. There, a script is completely executed even if there is errors.



To add this functionality to an ASP page add the following line at the top of the asp page
<% On Error Resume Next%>
To Disable this functionality, use the following statement
<%On Error GoTo 0%>

If you do not use the ON Error resume next statement and a fatal run time error occurs, an error message is displayed and the ASP page stops executing.
It is good programming practice to add the on error resume next statement at the top of the ASP page. However you can use the statement at any place you think appropriate.


No comments:

Post a Comment