UrlMappingCollection.Remove Método
Definição
Remove um objeto UrlMapping da coleção.Removes a UrlMapping object from the collection.
Sobrecargas
| Remove(String) |
Remove o objeto UrlMapping com o nome especificado da coleção.Removes the UrlMapping object with the specified name from the collection. |
| Remove(UrlMapping) |
Remove o objeto UrlMapping especificado da coleção.Removes the specified UrlMapping object from the collection. |
Remove(String)
Remove o objeto UrlMapping com o nome especificado da coleção.Removes the UrlMapping object with the specified name from the collection.
public:
void Remove(System::String ^ name);
public void Remove (string name);
member this.Remove : string -> unit
Public Sub Remove (name As String)
Parâmetros
- name
- String
O nome do objeto UrlMapping a ser removido da coleção.The name of the UrlMapping object to remove from the collection.
Exemplos
O exemplo de código a seguir remove o UrlMapping objeto do UrlMappingCollection .The following code example removes the UrlMapping object from the UrlMappingCollection.
Consulte o exemplo de código no UrlMappingCollection tópico de classe para saber como obter a coleção.Refer to the code example in the UrlMappingCollection class topic to learn how to get the collection.
// Remove the URL with the
// specified name from the collection
// (if exists).
urlMappings.Remove("~/default.aspx");
// Update the configuration file.
if (!urlMappingSection.IsReadOnly())
configuration.Save();
' Remove the URL with the
' specified name from the collection
' (if exists).
urlMappings.Remove("~/home.aspx")
' Update the configuration file.
If Not urlMappingSection.IsReadOnly() Then
configuration.Save()
End If
Comentários
O Remove método exclui o add elemento na urlMappings seção no nível de hierarquia atual e insere um remove elemento.The Remove method deletes the add element in the urlMappings section at the current hierarchy level and inserts a remove element. O elemento remove efetivamente remove a referência ao add elemento definido nos arquivos de configuração pai em níveis mais altos na hierarquia, mas não o exclui.The remove element effectively removes the reference to the add element defined in the parent configuration files at higher levels in the hierarchy but does not delete it.
Confira também
Aplica-se a
Remove(UrlMapping)
Remove o objeto UrlMapping especificado da coleção.Removes the specified UrlMapping object from the collection.
public:
void Remove(System::Web::Configuration::UrlMapping ^ urlMapping);
public void Remove (System.Web.Configuration.UrlMapping urlMapping);
member this.Remove : System.Web.Configuration.UrlMapping -> unit
Public Sub Remove (urlMapping As UrlMapping)
Parâmetros
- urlMapping
- UrlMapping
O objeto UrlMapping a ser removido da coleção.The UrlMapping object to remove from the collection.
Exemplos
O exemplo de código a seguir remove o UrlMapping objeto do UrlMappingCollection .The following code example removes the UrlMapping object from the UrlMappingCollection.
Consulte o exemplo de código no UrlMappingCollection tópico de classe para saber como obter a coleção.Refer to the code example in the UrlMappingCollection class topic to learn how to get the collection.
// Create a UrlMapping object.
urlMapping = new UrlMapping(
"~/home.aspx", "~/default.aspx?parm1=1");
// Remove it from the collection
// (if exists).
urlMappings.Remove(urlMapping);
// Update the configuration file.
if (!urlMappingSection.IsReadOnly())
configuration.Save();
' Create a UrlMapping object.
urlMapping = New UrlMapping( _
"~/home.aspx", "~/default.aspx?parm1=1")
' Remove it from the collection
' (if exists).
urlMappings.Remove(urlMapping)
' Update the configuration file.
If Not urlMappingSection.IsReadOnly() Then
configuration.Save()
End If
Comentários
O Remove método exclui o add elemento na urlMappings seção no nível de hierarquia atual e insere um remove elemento.The Remove method deletes the add element in the urlMappings section at the current hierarchy level and inserts a remove element. O elemento remove efetivamente remove a referência ao add elemento definido nos arquivos de configuração pai em níveis mais altos na hierarquia, mas não o exclui.The remove element effectively removes the reference to the add element defined in the parent configuration files at higher levels in the hierarchy but does not delete it.