UrlMappingCollection.Add(UrlMapping) Method

Definition

Adds the specified UrlMapping to the collection.

C#
public void Add(System.Web.Configuration.UrlMapping urlMapping);

Parameters

urlMapping
UrlMapping

The UrlMapping object to add to the collection.

Examples

The following code example adds a UrlMapping object to the UrlMappingCollection.

Refer to the code example in the UrlMappingCollection class topic to learn how to get the collection.

C#

// Create a new UrlMapping object.
urlMapping = new UrlMapping(
  "~/home.aspx", "~/default.aspx?parm1=1");
  
// Add the urlMapping to 
// the collection.
urlMappings.Add(urlMapping);

// Update the configuration file.
if (!urlMappingSection.IsReadOnly())
  configuration.Save();

Applies to

Produkt Verzie
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also