System.Web Namespace HttpException Class
Constructs a new Exception object.
1. Constructs an empty Exception object.
2. Constructs an Exception using a supplied error message.
3. Constructs an Exception using an HTTP error code and an error message.
4. Constructs an Exception using an error message and the InnerException property.
5. Constructs an Exception using error message and an exception code.
6. Constructs an Exception using an HTTP error code, an error message, and the InnerException property.
7. Constructs an Exception using HTTP error code, an error message, and an exception code.
The following example throws an exception if a user-entered value is 0.
NOTE: This example shows how to use one of the overloaded versions of the HttpException constructor. For other examples that might be available, see the individual overload topics.
[ VB ]
If Num = 0 Then
Throw New HttpException ( "No value entered", 100 )
end if
[ C# ]
if ( Num == 0 ) {
throw new HttpException ( "No value entered", 100 );
}
HttpException Members