CustomErrorsSection クラスとは? わかりやすく解説

CustomErrorsSection クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

ASP.NET カスタム エラー構成します。このクラス継承できません。

名前空間: System.Web.Configuration
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 CustomErrorsSection
    Inherits ConfigurationSection
Dim instance As CustomErrorsSection
public sealed class CustomErrorsSection : ConfigurationSection
public ref class CustomErrorsSection sealed
 : public ConfigurationSection
public final class CustomErrorsSection extends
 ConfigurationSection
public final class CustomErrorsSection extends
 ConfigurationSection
解説解説

CustomErrorsSection クラス使用すると、構成ファイルcustomErrors セクションプログラムかアクセスして変更できます。この型は、CustomErrorCollection 型、CustomErrorsMode 型、CustomError 型を含むグループ一部です。

メモメモ

CustomErrorsSection は、値が Everywhereセクション プロパティ AllowDefinition に従って構成ファイル内の関連するセクションから情報読み込んだり、このセクション情報書き込んだできます

使用例使用例

この例では、customErrors 要素 (ASP.NET 設定スキーマ) セクション複数属性に対して宣言によって値を指定する方法示してます。これらの属性には、CustomErrorsSection クラスメンバとしてもアクセスできます

次の構成ファイルの例では、customErrors セクションに対して宣言によって値を指定する方法示します

<customErrors mode="RemoteOnly"
  defaultRedirect="customerror.htm">
    <error statusCode="404" redirect="customerror404.htm"/>
</customErrors>

CustomErrorsSection クラス使用する方法次のコード例示します

      ' 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.Object
   System.Configuration.ConfigurationElement
     System.Configuration.ConfigurationSection
      System.Web.Configuration.CustomErrorsSection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CustomErrorsSection メンバ
System.Web.Configuration 名前空間
CustomError クラス
CustomErrorCollection クラス
CustomErrorsMode 列挙
その他の技術情報
customErrors 要素 (ASP.NET 設定スキーマ)



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CustomErrorsSection クラス」の関連用語

CustomErrorsSection クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CustomErrorsSection クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS