次の方法で共有


<error> 要素

HTTP ステータス コードと関連付けられた 1 つのカスタム エラー リダイレクトを定義します。

<configuration>
   <system.web>
      <customErrors>
         <error>

<error statusCode="statuscode"       redirect="url"/>

省略可能属性

属性 説明
StatusCode エラー ページへのリダイレクトを指示する HTTP ステータス コードを指定します。
Redirect エラーについての情報をクライアントに対して示すエラー ページ。

ASP.NET アプリケーションで使用するエラー処理ページを指定する例を次に示します。

<configuration>
   <system.web>
      <customErrors defaultRedirect="GenericError.htm"
                    mode="RemoteOnly">
         <error statusCode="500"
                redirect="InternalError.htm"/>
      </customErrors>
   </system.web>
</configuration>

必要条件

格納されている場所 : <system.web>

Web プラットフォーム : IIS 5.0、IIS 5.1、IIS 6.0

構成ファイル : Machine.config、Web.config

構成セクション ハンドラ : System.Web.Configuration.CustomErrorsConfigHandler

参照

<customErrors> 要素 | ASP.NET の構成 | ASP.NET 設定スキーマ