HttpException コンストラクター

定義

HttpException クラスの新しいインスタンスを初期化します。

オーバーロード

HttpException()

HttpException クラスの新しいインスタンスを初期化し、空の HttpException オブジェクトを作成します。

HttpException(String)

指定したエラー メッセージを使用して、HttpException クラスの新しいインスタンスを初期化します。

HttpException(Int32, String)

HTTP 応答ステータス コードとエラー メッセージを使用して、HttpException クラスの新しいインスタンスを初期化します。

HttpException(SerializationInfo, StreamingContext)

シリアル化したデータを使用して、HttpException クラスの新しいインスタンスを初期化します。

HttpException(String, Exception)

エラー メッセージと HttpException プロパティを使用して、InnerException クラスの新しいインスタンスを初期化します。

HttpException(String, Int32)

エラー メッセージと例外コードを使用して、HttpException クラスの新しいインスタンスを初期化します。

HttpException(Int32, String, Exception)

HTTP 応答ステータス コード、エラー メッセージ、および HttpException プロパティを使用して、InnerException クラスの新しいインスタンスを初期化します。

HttpException(Int32, String, Int32)

HTTP 応答ステータス コード、エラー メッセージ、および例外コードを使用して、HttpException クラスの新しいインスタンスを初期化します。

HttpException()

HttpException クラスの新しいインスタンスを初期化し、空の HttpException オブジェクトを作成します。

public:
 HttpException();
public HttpException ();
Public Sub New ()

次のコード例は、クラスの HttpException コンストラクターを HttpException 示しています。 このメソッドは CheckNumber 、テキスト ボックスを通じてユーザーが入力した値を受け取り、それが整数であるかどうかを確認します。 値が整数でない場合は、例外がスローされ、新 HttpException しいオブジェクトが作成されてスローされます。 その例外はイベント ハンドラーで Button_Click キャッチされ、エラー メッセージがブラウザーに表示されます。

重要

この例には、ユーザー入力を受け付けるテキスト ボックスがあります。これにより、セキュリティが脆弱になる可能性があります。 既定では、ASP.NET Web ページによって、ユーザー入力にスクリプトまたは HTML 要素が含まれていないかどうかが検証されます。 詳細については、「スクリプトによる攻略の概要」を参照してください。


<html xmlns="http://www.w3.org/1999/xhtml" >
   <head>
    <title>
            Example for HttpException
         </title>
<script language="C#" runat="server">
         void CheckNumber()
         {
            try
            {
               // Check whether the value is an integer.
               String convertInt = textbox1.Text;
               Convert.ToInt32(convertInt);
            }
            catch(Exception e)
            {
               // Throw a 'HttpException' object.
               throw new HttpException();
            }
         }
      
         void Button_Click(Object sender, EventArgs e)
         {
            try
            {
               CheckNumber();
               label1.Text = "The integer value you entered is: "+textbox1.Text;
            }
            catch(HttpException exp)
            {
               label1.Text = "<font color='red'>An HttpException was raised!:"
                  + " The value entered in the textbox is not an integer.</font>";
            }
         }

         void page_load(object sender,EventArgs e)
         {
            label1.Text="";
         }
      </script>
   </head>
   
   <body>
      <center>
         <h3>
            Example for HttpException
         </h3>
      </center>
      
      <form id="WebForm9" method="post" runat="server">
         <center>
         <br />
         <b>Enter a value in the text box.</b>
         <br />
         <asp:TextBox Runat="server" ID="textbox1"></asp:TextBox>
         <br />
         <asp:Button Text="Click Here" OnClick="Button_Click" Runat="server"></asp:Button>
         <br />
         <b><asp:Label Runat="server" ID="label1"></asp:Label></b>
         </center>
      </form>
   </body>
</html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
   <head>
    <title>Example for HttpException</title>
<script language="VB" runat="server">
         Sub CheckNumber()
            Try
               ' Check whether the value is an integer.
               Dim convertInt As [String] = textbox1.Text
               Convert.ToInt32(convertInt)
            Catch e As Exception
               ' Throw the 'HttpException' object.
               Throw New HttpException()
            End Try
         End Sub 'CheckNumber
 
         Sub Button_Click(sender As [Object], e As EventArgs)
            Try
               CheckNumber()
               label1.Text = "The integer value you entered is: " + textbox1.Text
            Catch exp As HttpException
               label1.Text = "<font color='red'>An HttpException was raised!:" _
                  & " The value entered in the textbox is not an integer</font>"
            End Try
         End Sub 'Button_Click
       
         Sub Page_Load(sender As [Object], e As EventArgs)
            label1.Text=""
         End Sub
      </script>
   </head>

   <body>
      <center>
         <h3>Example for HttpException</h3>
      </center>
      <form id="WebForm9" method="post" runat="server">
         <center>
            <b>Enter a value in the text box.</b>
            <asp:TextBox Runat="server" ID="textbox1"></asp:TextBox>
            <br />
            <asp:Button Text="Click Here" OnClick="Button_Click" Runat="server"></asp:Button>
            <br />
            <b><asp:Label Runat="server" ID="label1"></asp:Label></b>
         </center>
      </form>
   </body>
</html>

注釈

例外を処理する場合は、内部例外に応答してスローされる外部例外を含む一連の関連する例外をキャプチャすると便利です。

外側の例外の原因となった内部例外への参照は、外側の InnerException 例外のプロパティから使用できます。 このメカニズムでは、元の例外を含め、以前の例外によって実行されたエラー情報が保持されますが、より意味のある外側の例外を作成できます。 詳細については、「InnerException」を参照してください。

こちらもご覧ください

適用対象

HttpException(String)

指定したエラー メッセージを使用して、HttpException クラスの新しいインスタンスを初期化します。

public:
 HttpException(System::String ^ message);
public HttpException (string message);
new System.Web.HttpException : string -> System.Web.HttpException
Public Sub New (message As String)

パラメーター

message
String

例外がスローされたときに、クライアントに表示するエラー メッセージ。

次のコード例は、クラスの HttpException コンストラクターを HttpException 示しています。 ユーザーが入力した値が 0 の場合は、An HttpException がスローされます。

重要

この例には、ユーザー入力を受け付けるテキスト ボックスがあります。これにより、セキュリティが脆弱になる可能性があります。 既定では、ASP.NET Web ページによって、ユーザー入力にスクリプトまたは HTML 要素が含まれていないかどうかが検証されます。 詳細については、「スクリプトによる攻略の概要」を参照してください。

if (Num == 0)
{
   throw new HttpException("No value entered");
}
If Num = 0 Then
   Throw New HttpException("No value entered")
end if

こちらもご覧ください

適用対象

HttpException(Int32, String)

HTTP 応答ステータス コードとエラー メッセージを使用して、HttpException クラスの新しいインスタンスを初期化します。

public:
 HttpException(int httpCode, System::String ^ message);
public HttpException (int httpCode, string message);
new System.Web.HttpException : int * string -> System.Web.HttpException
Public Sub New (httpCode As Integer, message As String)

パラメーター

httpCode
Int32

エラーに対応するクライアントに送信された HTTP 応答ステータス コード。

message
String

例外がスローされたときに、クライアントに表示するエラー メッセージ。

こちらもご覧ください

適用対象

HttpException(SerializationInfo, StreamingContext)

シリアル化したデータを使用して、HttpException クラスの新しいインスタンスを初期化します。

protected:
 HttpException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected HttpException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Web.HttpException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Web.HttpException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

パラメーター

info
SerializationInfo

スローされている例外に関するシリアル化済みオブジェクト データを保持している SerializationInfo

context
StreamingContext

転送元または転送先に関するコンテキスト情報を保持している StreamingContext

注釈

コンストラクターは HttpException 、ストリーム経由で送信される例外オブジェクトを再構成するために、逆シリアル化中に呼び出されます。 詳細については、「 XML および SOAP シリアル化」を参照してください。

こちらもご覧ください

適用対象

HttpException(String, Exception)

エラー メッセージと HttpException プロパティを使用して、InnerException クラスの新しいインスタンスを初期化します。

public:
 HttpException(System::String ^ message, Exception ^ innerException);
public HttpException (string message, Exception innerException);
new System.Web.HttpException : string * Exception -> System.Web.HttpException
Public Sub New (message As String, innerException As Exception)

パラメーター

message
String

例外がスローされたときに、クライアントに表示するエラー メッセージ。

innerException
Exception

現在の例外をスローした InnerException (存在する場合)。

次のコード例は、クラスの HttpException コンストラクターを HttpException 示しています。 このメソッドは CheckNumber 、テキスト ボックスを通じてユーザーが入力した値を受け取り、それが整数であるかどうかを確認します。 値が整数でない場合は例外がスローされ、catch ブロックでは新しい HttpException オブジェクトが作成されてスローされます。 その例外はイベント ハンドラーで Button_Click キャッチされ、エラー メッセージがブラウザーに表示されます。

重要

この例には、ユーザー入力を受け付けるテキスト ボックスがあります。これにより、セキュリティが脆弱になる可能性があります。 既定では、ASP.NET Web ページによって、ユーザー入力にスクリプトまたは HTML 要素が含まれていないかどうかが検証されます。 詳細については、「スクリプトによる攻略の概要」を参照してください。


<html xmlns="http://www.w3.org/1999/xhtml" >
   <head>
    <title>Example for HttpException</title>
<script language="C#" runat="server">    
         void CheckNumber()
         {
            try
            {
               // Check whether the value is an integer.
               String convertInt= textbox1.Text;
               Convert.ToInt32(convertInt);
            }
            catch(Exception e)
            {
               // Throw an HttpException object with a message.
               throw new HttpException("THe value entered in the text box is not a integer", e);
            }
         }
      
         void Button_Click(Object sender, EventArgs e)
         {
            try
            {
               CheckNumber();
               label1.Text = "The integer value you entered is: " + textbox1.Text;
            }
            catch(HttpException exp)
            {
               // Display the exception thrown.
               label1.Text = "<font color='red'>An HttpException was raised: " + exp.Message + "</font>";
               Exception myInnerException = exp.InnerException;
               label2.Text = "InnerException is : " + myInnerException.GetType();
            }
         }

         void page_load(Object sender,EventArgs e)
         {
            label1.Text="";
            label2.Text="";
         }
      </script>
   </head>

   <body>
      <center>
         <h3>Example for HttpException</h3>
      </center>
      <form id="Form1" method="post" runat="server">
         <center>
            <b>Enter the value in the text box </b>
            <br />
            <asp:TextBox Runat="server" ID="textbox1"></asp:TextBox>
            <br />
            <asp:Button Text="Click Here" OnClick="Button_Click" Runat="server" ID="Button1"></asp:Button>
            <br />
            <b>
               <asp:Label Runat="server" ID="label1"></asp:Label>
               <br />
               <asp:Label Runat="server" ID="label2"></asp:Label>
            </b>
         </center>
      </form>
   </body>
</html>

<html xmlns="http://www.w3.org/1999/xhtml" >
   <head>
    <title>Example for HttpException</title>
<script language="VB" runat="server">  
         Sub CheckNumber()
            Try
               ' Check whether the value is an integer.
               Dim convertInt As [String] = textbox1.Text
               Convert.ToInt32(convertInt)
            Catch e As Exception
               ' Throw an HttpException object with a message.
               Throw New HttpException("The value entered in the textbox is not a integer", e)
            End Try
         End Sub 'CheckNumber
       
         Sub Button_Click(sender As [Object], e As EventArgs)
            Try
               CheckNumber()
               label1.Text = "The integer value you entered is: " + textbox1.Text
            Catch exp As HttpException
               ' Display the exception thrown.
               label1.Text = "<font color='red'>An HttpException was raised!: " + exp.Message + "</font>"
               Dim myInnerException As Exception = exp.InnerException
               label2.Text = "InnerException is : " + myInnerException.GetType().ToString()
            End Try
         End Sub 'Button_Click
       
         Sub page_load(sender As [Object], e As EventArgs)
            label1.Text=""
            label2.Text="" 
         End Sub
      </script>
   </head>

   <body>
      <center>
      <h3>Example for HttpException</h3>
      <form id="WebForm9" method="post" runat="server">
         <b>Enter the value in the text box </b>
         <asp:TextBox Runat="server" ID="textbox1"></asp:TextBox>
         <br />
         <asp:Button Text="Click Here" OnClick="Button_Click" Runat="server" ID="Button1"></asp:Button>
         <br />
         <b>
         <asp:Label Runat="server" ID="label1"></asp:Label>
         <br />
         <asp:Label Runat="server" ID="label2"></asp:Label>
         </b>
      </form>
      </center>
   </body>
</html>

注釈

例外を処理する場合は、内部例外に応答してスローされる外部例外を含む一連の関連する例外をキャプチャすると便利です。

外側の例外の原因となった内部例外への参照は、外側の InnerException 例外のプロパティから使用できます。 このメカニズムでは、元の例外を含め、以前の例外によって実行されたエラー情報が保持されますが、より意味のある外側の例外を作成できます。 詳細については、「InnerException」を参照してください。

こちらもご覧ください

適用対象

HttpException(String, Int32)

エラー メッセージと例外コードを使用して、HttpException クラスの新しいインスタンスを初期化します。

public:
 HttpException(System::String ^ message, int hr);
public HttpException (string message, int hr);
new System.Web.HttpException : string * int -> System.Web.HttpException
Public Sub New (message As String, hr As Integer)

パラメーター

message
String

例外がスローされたときに、クライアントに表示するエラー メッセージ。

hr
Int32

エラーを定義する例外コード。

次のコード例は、クラスの HttpException コンストラクターを HttpException 示しています。 HttpExceptionユーザーが入力した値が 0 の場合、例外がスローされます。

重要

この例には、ユーザー入力を受け付けるテキスト ボックスがあります。これにより、セキュリティが脆弱になる可能性があります。 既定では、ASP.NET Web ページによって、ユーザー入力にスクリプトまたは HTML 要素が含まれていないかどうかが検証されます。 詳細については、「スクリプトによる攻略の概要」を参照してください。

if (Num == 0)
{
   throw new HttpException("No value entered", 100);
}
If Num = 0 Then
   Throw New HttpException("No value entered", 100)
end if

こちらもご覧ください

適用対象

HttpException(Int32, String, Exception)

HTTP 応答ステータス コード、エラー メッセージ、および HttpException プロパティを使用して、InnerException クラスの新しいインスタンスを初期化します。

public:
 HttpException(int httpCode, System::String ^ message, Exception ^ innerException);
public HttpException (int httpCode, string message, Exception innerException);
new System.Web.HttpException : int * string * Exception -> System.Web.HttpException
Public Sub New (httpCode As Integer, message As String, innerException As Exception)

パラメーター

httpCode
Int32

クライアントに表示する HTTP 応答ステータス コード。

message
String

例外がスローされたときに、クライアントに表示するエラー メッセージ。

innerException
Exception

現在の例外をスローした InnerException (存在する場合)。

次のコード例は、クラスの HttpException コンストラクターを HttpException 示しています。 このメソッドは CheckNumber 、ユーザーが入力した値を受け取り、それが整数であるかどうかを確認します。 値が整数でない場合は、例外がスローされ、HTTP 応答状態コード、例外のメッセージ、および内部例外を含む新しい HttpException オブジェクトが作成されます。 その例外はイベント ハンドラーで Button_Click キャッチされ、エラー メッセージ、エラー コード、および内部例外が表示されます。

重要

この例には、ユーザー入力を受け付けるテキスト ボックスがあります。これにより、セキュリティが脆弱になる可能性があります。 既定では、ASP.NET Web ページによって、ユーザー入力にスクリプトまたは HTML 要素が含まれていないかどうかが検証されます。 詳細については、「スクリプトによる攻略の概要」を参照してください。


<%@ Import Namespace="System.Drawing" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
   <head>
    <title>Example for HttpException</title>
<script language="C#" runat="server">
         void CheckNumber()
         {
            try
            {
               // Check whether the value is an integer.
               String convertInt = textbox1.Text;
               Convert.ToInt32(convertInt);
            }
            catch(Exception ex)
            {
               // Throw an HttpException object that contains the HTTP error code,
               // message, and inner exception.
               throw new HttpException(500, "The entered value is not an integer.", ex);
            }
         }
         
         void Button_Click(Object sender, EventArgs e)
         {
            try
            {
               CheckNumber();
               label1.Text = "The integer value you entered is: " + textbox1.Text;
            }
            catch(HttpException exp)
            {
               // Display the exception thrown.
               label1.ForeColor = Color.Red;
               label1.Text = "An HttpException was raised!: " + exp.Message;
               Exception myInnerException = exp.InnerException;
               
               // Display the inner exception.
               label2.Text = "The InnerException is : " + myInnerException.GetType();
                
            }
         }
     
         void page_load(Object sender,EventArgs e)
         {
           label1.Text="";
           label2.Text="";
         }

      </script>
   </head>

   <body>
      <center>
         <h3>Example for HttpException</h3>
         <form id="WebForm9" method="post" runat="server">
            <b>Enter the value in the text box </b>
            <br />
            <asp:TextBox Runat="server" ID="textbox1"></asp:TextBox>
            <br />
            <asp:Button Text="Click Here" OnClick="Button_Click" Runat="server" ID="Button1"></asp:Button>
            <br />
            <b>
               <asp:Label Runat="server" ID="label1"></asp:Label>
               <br />
               <asp:Label Runat="server" ID="label2"></asp:Label>
            </b>
         </form>
      </center>
   </body>
</html>

<%@ Import Namespace="System.Drawing" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
   <head>
    <title>Example for HttpException</title>
<script language="VB" runat="server">
         Sub CheckNumber()
            Try
               'Check whether the value is integer.
               Dim convertInt As [String] = textbox1.Text
               Convert.ToInt32(convertInt)
            Catch ex As Exception
               ' Throw an HttpException object that contains the HTTP error code,
               ' message, and inner exception.
               Throw New HttpException(500, "The entered value is not an integer.", ex)
            End Try
         End Sub
 
         Sub Button_Click(sender As [Object], e As EventArgs)
            Try
               CheckNumber()
               label1.Text = "The integer Value you entered is: " & textbox1.Text

            Catch exp As HttpException
               ' Display the Exception thrown.
               label1.ForeColor = Color.Red
               label1.Text = "An HttpException was raised: " & exp.Message

               Dim myInnerException As Exception = exp.InnerException

               ' Display the inner exception.
               label2.Text = "InnerException is : " & myInnerException.GetType().ToString()
                
            End Try
         End Sub 

         Sub page_load(sender As [Object], e As EventArgs)
            label1.Text = ""
            label2.Text = ""
         End Sub 
      </script>
   </head>

   <body>
      <center>
         <h3>Example for HttpException</h3>
         <form id="WebForm9" method="post" runat="server">
            <b>Enter the value in the text box.</b>
            <asp:TextBox Runat="server" ID="textbox1"></asp:TextBox>
            <br />
            <asp:Button Text="Click Here" OnClick="Button_Click" Runat="server" ID="Button1"></asp:Button>
            <br />
            <b>
            <asp:Label Runat="server" ID="label1"></asp:Label>
            <br />
            <asp:Label Runat="server" ID="label2"></asp:Label>
            </b>
         </form>
      </center>
   </body>
</html>

注釈

例外を処理する場合は、内部例外に応答してスローされる外部例外を含む一連の関連する例外をキャプチャすると便利です。

外側の例外の原因となった内部例外への参照は、外側の InnerException 例外のプロパティから使用できます。 このメカニズムでは、元の例外を含め、以前の例外によって実行されたエラー情報が保持されますが、より意味のある外側の例外を作成できます。 詳細については、「InnerException」を参照してください。

こちらもご覧ください

適用対象

HttpException(Int32, String, Int32)

HTTP 応答ステータス コード、エラー メッセージ、および例外コードを使用して、HttpException クラスの新しいインスタンスを初期化します。

public:
 HttpException(int httpCode, System::String ^ message, int hr);
public HttpException (int httpCode, string message, int hr);
new System.Web.HttpException : int * string * int -> System.Web.HttpException
Public Sub New (httpCode As Integer, message As String, hr As Integer)

パラメーター

httpCode
Int32

クライアントに表示する HTTP 応答ステータス コード。

message
String

例外がスローされたときに、クライアントに表示するエラー メッセージ。

hr
Int32

エラーを定義する例外コード。

次のコード例は、クラスの HttpException コンストラクターを HttpException 示しています。 ユーザー名と電子メール情報は、指定されたテキスト ボックスにユーザーによって入力されます。 いずれかのテキスト ボックスを空白のままにすると、 HttpException オブジェクトが作成されてスローされます。 このエラー コード HttpException はメソッドによって GetHttpCode 取得され、Web ページに表示されます。

重要

この例には、ユーザー入力を受け付けるテキスト ボックスがあります。これにより、セキュリティが脆弱になる可能性があります。 既定では、ASP.NET Web ページによって、ユーザー入力にスクリプトまたは HTML 要素が含まれていないかどうかが検証されます。 詳細については、「スクリプトによる攻略の概要」を参照してください。


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
   <head>
    <title>HttpException Example</title>
<script language="C#" runat="server">
         void SubmitButton_Click(Object sender, EventArgs e)
         {
            try
            {
               if(Textbox1.Text.Length==0 || Textbox2.Text.Length==0)
               {
                  // Raise an Exception if the username or the emailfield field is empty.
                  throw new HttpException(901,"User name or email ID not provided.",333);
               }
               else
               {
                  MyLabel.Text="Hello "+Textbox1.Text+"<br />";
                  MyLabel.Text+="The Weekly newsletter is mailed to :"+
                           Textbox2.Text+"<br />";
               }
            }
            catch(HttpException ex)
            { 
               // Display the error code returned by the GetHttpCode method.
               MyLabel.Text="<h4><font color=\"red\">The exception is "+
                  ex.GetHttpCode() +" - "+ ex.Message + "</font></h4>";
            }
         }

         void Page_Load(object sender,EventArgs e)
         {
            MyLabel.Text="";
         }
      </script>
   </head>

   <body>
      <form runat="server" id="Form1">
         <h3>HttpException Example</h3>
         Enter UserName and Email
         <br /><br />
         UserName :
         <asp:TextBox ID="Textbox1" Runat="server"></asp:TextBox>
         <br />
         Email ID :
         <asp:TextBox ID="Textbox2" Runat="server"></asp:TextBox>
         <asp:Button ID="Button1" Text="Submit" OnClick="SubmitButton_Click" runat="server" />
         <br />
         <asp:label id="MyLabel" runat="server" />
      </form>
   </body>
</html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
   <head>
    <title>HttpException Example</title>
<script language="VB" runat="server">
         Sub SubmitButton_Click(sender As Object, e As EventArgs)
            Try
               If Textbox1.Text.Length = 0 Or Textbox2.Text.Length = 0 Then
                  ' Raise an Exception if the username or emailid field is empty.
                  Throw New HttpException(901, "User name or email ID not provided", 333)
               Else
                  MyLabel.Text = "Hello " & Textbox1.Text & "<br />"
                  MyLabel.Text += "The Weekly newsletter is mailed to :" & Textbox2.Text & "<br />"
               End If
            Catch ex As HttpException
               ' Display the error code returned by the GetHttpCode method.
            MyLabel.Text = "<h4><font color=""red"">The exception is " & ex.GetHttpCode() & _
               " - " & ex.Message & "</font></h4>"
            End Try
         End Sub

         Sub Page_Load(sender As Object, e As EventArgs)
            MyLabel.Text = ""
         End Sub
      </script>
   </head>

   <body>
      <form runat="server" id="Form1">
         <h3>HttpException Example</h3>
         Enter User name and Email
         <br /><br />
         User Name:
         <asp:TextBox ID="Textbox1" Runat="server"></asp:TextBox>
         <br />
         Email ID:
         <asp:TextBox ID="Textbox2" Runat="server"></asp:TextBox>
         <asp:Button ID="Button1" Text="Submit" OnClick="SubmitButton_Click" runat="server"/>
         <br />
         <asp:label id="MyLabel" runat="server"/>
      </form>
   </body>
</html>

こちらもご覧ください

適用対象