共用方式為


HttpHandlerActionCollection.Remove 方法

定義

從集合中移除 HttpHandlerAction 物件。

多載

Remove(HttpHandlerAction)

從集合中移除 HttpHandlerAction 物件。

Remove(String, String)

從集合移除具有指定之 HttpHandlerActionVerb 屬性的 Path 物件。

Remove(HttpHandlerAction)

從集合中移除 HttpHandlerAction 物件。

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)

參數

action
HttpHandlerAction

要移除的 HttpHandlerAction 物件。

例外狀況

集合中不存在傳遞的 HttpHandlerAction 物件,該項目可能已經移除,或者集合是唯讀的。

範例

下列程式碼範例示範如何從集合中移除 HttpHandlerAction 物件。


// 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)

備註

這個方法會將 remove 元素插入組態檔的適當區段中,以取得較高層級組態檔中定義的任何專案。 如果專案是在目前組態檔的適當區段中定義,則會從組態檔中移除其專案。 要移除的物件必須存在於集合中。

適用於

Remove(String, String)

從集合移除具有指定之 HttpHandlerActionVerb 屬性的 Path 物件。

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)

參數

verb
String

要移除之屬於處理常式的 Verb 屬性值。

path
String

要移除之屬於處理常式的 Path 屬性值。

例外狀況

集合中沒有具備指定索引鍵的 HttpHandlerAction 物件,該項目可能已經移除,或者集合是唯讀的。

範例

下列程式碼範例示範如何從集合中移除 HttpHandlerAction 物件。


// 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")

備註

這個方法會將 remove 元素插入組態檔的適當區段中,以取得較高層級組態檔中定義的任何專案。 如果專案是在目前組態檔的適當區段中定義,則會從組態檔中移除其專案。 要移除的物件必須存在於集合中。

適用於