ערוך

שתף באמצעות


HttpHandlerActionCollection.Remove Method

Definition

Removes an HttpHandlerAction object from the collection.

Overloads

Remove(HttpHandlerAction)

Removes an HttpHandlerAction object from the collection.

Remove(String, String)

Removes an HttpHandlerAction object with the specified Verb and Path properties from the collection.

Remove(HttpHandlerAction)

Removes an HttpHandlerAction object from the collection.

public:
 void Remove(System::Web::Configuration::HttpHandlerAction ^ action);
public void Remove (System.Web.Configuration.HttpHandlerAction action);
member this.Remove : System.Web.Configuration.HttpHandlerAction -> unit
Public Sub Remove (action As HttpHandlerAction)

Parameters

action
HttpHandlerAction

The HttpHandlerAction object to remove.

Exceptions

The passed HttpHandlerAction object does not exist in the collection, the element has already been removed, or the collection is read-only.

Examples

The following code example shows how to remove an HttpHandlerAction object from the collection.


// Remove a HttpHandlerAction object 
    HttpHandlerAction httpHandler3 = new HttpHandlerAction(
     "Calculator.custom",
     "Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler",
     "GET", true);
    httpHandlers.Remove(httpHandler3);

' Remove a HttpHandlerAction object 
    Dim httpHandler3 As System.Web.Configuration.HttpHandlerAction  = new HttpHandlerAction( _
    "Calculator.custom", _
    "Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler", _
    "GET", _
    true)
    httpHandlers.Remove(httpHandler3)

Remarks

This method inserts a remove element into the appropriate section of the configuration file for any element defined in a higher-level configuration file. If the element is defined in the appropriate section of the current configuration file, its entry is removed from the configuration file. The object to remove must exist in the collection.

Applies to

Remove(String, String)

Removes an HttpHandlerAction object with the specified Verb and Path properties from the collection.

public:
 void Remove(System::String ^ verb, System::String ^ path);
public void Remove (string verb, string path);
member this.Remove : string * string -> unit
Public Sub Remove (verb As String, path As String)

Parameters

verb
String

The Verb property value that belongs to the handler to remove.

path
String

The Path property value that belongs to the handler to remove.

Exceptions

There is no HttpHandlerAction object with the specified key in the collection, the element has already been removed, or the collection is read-only.

Examples

The following code example shows how to remove an HttpHandlerAction object from the collection.


// Remove the handler with the specified verb and path.
httpHandlers.Remove("GET", "*.custom");

'Remove the handler with the specified verb and path.
httpHandlers.Remove("GET", "*.custom")

Remarks

This method inserts a remove element into the appropriate section of the configuration file for any element defined in a higher-level configuration file. If the element is defined in the appropriate section of the current configuration file, its entry is removed from the configuration file. The object to remove must exist in the collection.

Applies to