
308
|
Chapter 15: The HttpException Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Comments/Troubleshooting
We’ll use the following code listing as the basis for most examples in the chapter.
Unless otherwise noted, each example will consist of just the Page_Load event
handler for that particular example. Any displayed output messages or return
values will be shown as the Text property of the ASP.NET Label control named
Message or displayed by calling Response.Write:
<%@ Page Language="vb" %>
<html>
<head>
<script runat="server">
Sub Page_Load( )
'Example code will go here
End Sub
</script>
</head>
<body>
<asp:label id="Message" forecolor="red" runat="server"/>
</body>
</html>
Constructor Reference
The HttpException provides several overloaded constructors for communicating
custom HTTP error information:
Dim MyHttpEx As New HttpException( )
Creates an empty instance of HttpException.
Throw New HttpException(string)
Throws an HttpException whose Message property is set to the value of the
string passed into the constructor.
Throw New HttpException(integer, string)
Throws an HttpException whose GetHttpCode method will return the
integer value passed into the constructor, and whose Message property is set
to the value of the string passed into the constructor.
Throw New HttpException(string, Exception)
Throws an HttpException whose Message ...