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


UrlMappingsSection クラスを使用すると、構成ファイルの urlMappings セクションにプログラムからアクセスして変更できます。
![]() |
---|
urlMappings セクションには、ユーザーに表示される URL を Web アプリケーションに存在する URL に割り当てる UrlMapping オブジェクトが格納されます。UrlMappingsSection は、値が MachineToApplication のセクション プロパティ AllowDefinition で定義される制限に従って、構成ファイルの関連するセクションに情報を書き込むことができます。階層構造の許可されていないレベルで構成ファイルに書き込みを行おうとした場合、パーサーによってエラー メッセージが生成されます。ただし、このクラスを使用して、階層構造の任意のレベルに構成情報を読み込むことができます。 |

既存の Web アプリケーションの構成ファイルから UrlMappingsSection オブジェクトを取得する方法を次のコード例に示します。構成ファイルからの抜粋も示します。
' Get the Web application configuration. Dim configuration _ As System.Configuration.Configuration = _ WebConfigurationManager.OpenWebConfiguration( _ "/aspnetTest") ' Get the <urlMapping> section. Dim urlMappingSection _ As UrlMappingsSection = _ CType(configuration.GetSection( _ "system.web/urlMappings"), UrlMappingsSection) ' Get the url mapping collection. Dim urlMappings _ As UrlMappingCollection = _ urlMappingSection.UrlMappings
// Get the Web application configuration. System.Configuration.Configuration configuration = WebConfigurationManager.OpenWebConfiguration( "/aspnetTest"); // Get the <urlMapping> section. UrlMappingsSection urlMappingSection = (UrlMappingsSection)configuration.GetSection( "system.web/urlMappings"); // Get the url mapping collection. UrlMappingCollection urlMappings = urlMappingSection.UrlMappings;

System.Configuration.ConfigurationElement
System.Configuration.ConfigurationSection
System.Web.Configuration.UrlMappingsSection


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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