.NET Samples - ASP.NET Deployment
This section includes the following samples:
Error3 Sample
Error1 Sample
Custom2 Sample
Custom1 Sample
Error2 Sample
Error3 Sample
This sample demonstrates how to programmatically send e-mail in response to an unexpected exception in your ASP.NET Web application.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
System.Web; System; System.Web.Mail
Classes used in this sample:
String; EventArgs; Message; Form; MailMessage; Object; Site; SmtpMail; Page; Import; Url
Error1 Sample
This sample demonstrates the Debug attribute of the ASP.NET page directive to display line numbers for a run-time exception.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
(none)
Classes used in this sample:
Debug; String; Page; Application; Object; EventArgs
Custom2 Sample
This sample demonstrates how to use the <error> tag in ASP.NET configuration. The sample specifies an .aspx page for "File Not Found" errors so that the missing page URL passed by way of the QueryString property can be printed.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
(none)
Classes used in this sample:
String; Object; EventArgs
Custom1 Sample
This sample demonstrates the use of the <customErrors> configuration section in ASP.NET for customizing error messages.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
(none)
Classes used in this sample:
String; Object; EventArgs
Error2 Sample
This sample demonstrates how to override the Page_Error method in your ASP.NET pages to perform custom handling of unexpected exceptions.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
(none)
Classes used in this sample:
String; Object; EventArgs; Url; Page