UrlMappingCollection.Add(UrlMapping) Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Voegt de opgegeven UrlMapping waarde toe aan de verzameling.
public:
void Add(System::Web::Configuration::UrlMapping ^ urlMapping);
public void Add(System.Web.Configuration.UrlMapping urlMapping);
member this.Add : System.Web.Configuration.UrlMapping -> unit
Public Sub Add (urlMapping As UrlMapping)
Parameters
- urlMapping
- UrlMapping
Het UrlMapping object dat moet worden toegevoegd aan de verzameling.
Voorbeelden
In het volgende codevoorbeeld wordt een UrlMapping object toegevoegd aan de UrlMappingCollection.
Raadpleeg het codevoorbeeld in het UrlMappingCollection klasseonderwerp voor meer informatie over het ophalen van de verzameling.
// 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();
' 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 Not urlMappingSection.IsReadOnly() Then
configuration.Save()
End If