CustomErrorCollection クラス
アセンブリ: System.Web (system.web.dll 内)


CustomErrorCollection 型を使用して、customErrors セクション要素コレクションの error 要素にアクセスできます。
これは、CustomError、CustomErrorsMode、および CustomErrorsSection を含むグループの一部です。

この例では、customErrors セクションの error 要素に対して、宣言によって値を指定する方法を示しています。これらの要素には、CustomErrorCollection コレクションの要素としてもアクセスできます。
次の構成ファイルの例では、error 要素に対して、宣言によって値を指定する方法を示しています。
<customErrors mode="RemoteOnly" defaultRedirect="customerror.htm"> <error statusCode="404" redirect="customerror404.htm"/> </customErrors>
CustomErrorCollection クラスを使用する方法を次のコード例に示します。
' Get the Web application configuration. Dim configuration _ As System.Configuration.Configuration = _ WebConfigurationManager.OpenWebConfiguration( _ "/aspnetTest") ' Get the section. Dim customErrorsSection _ As CustomErrorsSection = _ CType(configuration.GetSection( _ "system.web/customErrors"), _ CustomErrorsSection) ' Get the collection Dim customErrorsCollection _ As CustomErrorCollection = customErrorsSection.Errors
// Get the Web application configuration. System.Configuration.Configuration configuration = WebConfigurationManager.OpenWebConfiguration( "/aspnetTest"); // Get the section. CustomErrorsSection customErrorsSection = (CustomErrorsSection)configuration.GetSection( "system.web/customErrors"); // Get the collection CustomErrorCollection customErrorsCollection = customErrorsSection.Errors;

System.Configuration.ConfigurationElement
System.Configuration.ConfigurationElementCollection
System.Web.Configuration.CustomErrorCollection


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- CustomErrorCollection クラスのページへのリンク