The following code example demonstrates the HttpException constructor of the HttpException class. An HttpException exception is thrown if a user-entered value is 0.
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview (Visual Studio).