Export (0) Print
Expand All

Adding a Replacement Method 

To add a replacement method to a request handler using Visual Studio

  1. Open the server response file in the HTML designer.

  2. Switch to HTML view.

  3. Add a replacement tag to the server response file:

    {{TagName}}
    
  4. Right-click the tag and click Add Tag Handler on the shortcut menu.

  5. Implement the replacement method.

    For details, see Choosing a Return Value for a Replacement Method.

To manually add a replacement method to a request handler

  1. Add the replacement method to the appropriate request handler:

    HTTP_CODE MethodName()
    {
        // TODO - add your code here
        return HTTP_SUCCESS;
    }
    
  2. Implement the replacement method.

    For details, see Choosing a Return Value for a Replacement Method.

  3. Add an entry for the method to the replacement method map in the same class:

    BEGIN_REPLACEMENT_METHOD_MAP(RequestHandlerName)
        // ...
        REPLACEMENT_METHOD_ENTRY("TagName", MethodName)
    END_REPLACEMENT_METHOD_MAP()
    

    –or–

    Apply the tag_name attribute to the method:

    [tag_name("TagName")]
    HTTP_CODE MethodName()
    
  4. Add a replacement tag to one or more server response files that use that request handler:

    {{TagName}}
    

See Also

Community Additions

ADD
Show:
© 2014 Microsoft