Handling Errors

To demonstrate the different techniques for handling errors, we need a web application that will generate them on demand. To that end, we'll create an ASP.NET application that will let us select one of three different C# exceptions to throw when we submit a form.

Creating the Handling Errors Example

To create the sample project, follow these steps:

  1. Create a new Visual Studio project using the ASP.NET Empty Web Application template.
  2. Given the project the name Handling Errors, as shown in Figure 7-1.
    images

    Figure 7-1. Creating the Handling Errors project

  3. To add a web page, select Project Add New Item.
  4. Select the Web Form template, ...

Get Applied ASP.NET 4 in Context now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.