I have button in the layout and action for it is defined in the base controller. How can I invoke this action every time using a common js this button is clicked in individual page?
Below is a barebones of my scenario, I have a button in layout and child uses this layout. Child has is controller ChildController which inherits from BaseController. Action is defined in the base.
Is it possible to have a common js (or any other way) which routes to the same action, so that individual page doesnt need any additional code?
_Layout.cshtml has - Exit button
<button id="exitButton">Exit</button>
ChildPage is using _Layout.cshtml
public class ControllerBase
{
[HttpPost]
public void Exit()
{}
}
public class ChildController : ControllerBase {}