How to call a non action method by clicking a button in MVC?
Sigiloso
We can call non action method using three approaches : 1) Server-Side Method: If you need server-side logic, create a public action method in the controller that calls the non-action method and trigger it through a form submission or link/button click. 2) Client-Side Method: Use JavaScript to handle the logic entirely on the client side if no server interaction is needed. 3) AJAX Method: Use AJAX to call a controller action that invokes the non-action method without refreshing the page.