UrlMappingCollection Class
.NET Framework 2.0
Represents a collection of UrlMapping objects. This class cannot be inherited.
Namespace: System.Web.Configuration
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
'Declaration Public NotInheritable Class UrlMappingCollection Inherits ConfigurationElementCollection 'Usage Dim instance As UrlMappingCollection
public final class UrlMappingCollection extends ConfigurationElementCollection
public final class UrlMappingCollection extends ConfigurationElementCollection
Not applicable.
The UrlMappingCollection type allows access to the UrlMappings elements of the UrlMappingsSection section element collection.
The following code example shows how to obtain the UrlMappingCollection object from the configuration file of an existing Web application. Also shown is an excerpt of the configuration file.
<urlMappings enabled="true">
<add url= "~/home.aspx"
mappedUrl="~/default.aspx?parm1=1"/>
<add url= "~/products.aspx"
mappedUrl="~/default.aspx?parm1=2"/>
</urlMappings>
' 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
System.Object
System.Configuration.ConfigurationElement
System.Configuration.ConfigurationElementCollection
System.Web.Configuration.UrlMappingCollection
System.Configuration.ConfigurationElement
System.Configuration.ConfigurationElementCollection
System.Web.Configuration.UrlMappingCollection
Community Additions
ADD
Show: