HttpHandlerActionCollection.Add(HttpHandlerAction) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds an HttpHandlerAction object to the collection.
public:
void Add(System::Web::Configuration::HttpHandlerAction ^ httpHandlerAction);
public void Add (System.Web.Configuration.HttpHandlerAction httpHandlerAction);
member this.Add : System.Web.Configuration.HttpHandlerAction -> unit
Public Sub Add (httpHandlerAction As HttpHandlerAction)
Parameters
- httpHandlerAction
- HttpHandlerAction
The HttpHandlerAction object to add to the collection.
Exceptions
The HttpHandlerAction object to add already exists in the collection or the collection is read-only.
Examples
The following code example shows how to create an HttpHandlerAction object and add it to the collection.
// Add a new HttpHandlerAction to the Handlers property HttpHandlerAction collection.
httpHandlersSection.Handlers.Add(new HttpHandlerAction(
"Calculator.custom",
"Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler",
"GET",
true));
' Add a new HttpHandlerAction to the Handlers property HttpHandlerAction collection.
httpHandlersSection.Handlers.Add(new HttpHandlerAction( _
"Calculator.custom", _
"Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler", _
"GET", _
true))
Remarks
Before using this method you must create an HttpHandlerAction object and initialize it with the proper name and type. After that, you can add the object just created to the collection.
Note
ASP.NET searches for the handler assembly DLL in the application's private Bin directory first, and then it searches in the system assembly cache.
The collection must not already contain an HttpHandlerAction object with the same Verb and Path properties.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기