Invoke Custom Method Not Refreshing Correctly

I ran into a small issue while testing custom methods. After using a custom method in a Radzen page, I modified the number of parameters used in the server function. Back in Radzen, clicking the refresh button for the custom method causes the parameter list to update correctly. But, when the code is compiled and executed, the deleted parameter is still submitted to the server.

To reproduce in v2.32.4:

  1. Create a new project, add a blank page, and add a button.

  2. Open the ServerMethodsController.cs file.

  3. Uncomment the default 'Sum' function which requires 'x' and 'y' parameters:

     public IActionResult Sum(int x, int y)
         var sum = x + y;
         return Json(new { sum });
  4. Open the button properties on the new page, and open the click event.

  5. Add an event handler and set its type to 'Invoke custom method'

  6. Set 'Name' to 'Sum' (click the refresh button if required)
    6a) Hard code x and y parameters to any numeric value. I used 10 and 20.

  7. Click 'Done'

  8. Run the program and open the new page in Chrome

  9. Press F12 to open developer tools and click the network tab.

  10. Click the button on the new page. An entry should be visible in the network traffic with the 'x' and 'y' parameters: http://localhost:5000/api/ServerMethods/Sum?x=10&y=20

  11. Stop the server.

  12. Change the Sum function to accept only the 'x' parameter. And change the code to remove the 'y' parameter:

    public IActionResult Sum(int x)
        var sum = x + 20;
        return Json(new { sum });
  13. Open the new page in Radzen and open the button click event.

  14. The custom invoke for Sum still shows 'y'. (That's okay, just need to refresh.)

  15. Click the refresh button next to the method name. This will remove the extra 'y' parameter.

  16. Run the program. Repeating steps 8 through 10 reveal the 'y' parameter is still being submitted with the old hard coded value.

To correct the problem I must delete the custom method event handler. I then have to click 'Done' to let the ts file rebuild. Then, reopen the click event and add the event handler back in.

I discovered this issue because I was attempting to change a server method from the default HttpGet to HttpPut. I was also adding FromForm to the parameters. This works well, but I discovered the angular code was being very stubborn about updating.

Does my process look correct? Am I missing something?

Thank You.

For it is safest to remove the handler that invokes the custom method altogether. We will see if this can be avoided in a future Radzen release.