I have referred below Article to display button in my Configuration page.
https://magecomp.com/blog/add-a-button-in-magento-2-stores-configuration-with-custom-action/
In file
app\code\Vendor\Extension\Block\System\Config\Button.php
there is a function where we can define our Ajax URL
public function getAjaxUrl()
{
return $this->getUrl(‘your action Url’);
}
So for this, I want to create controller in Adminhtml which i can access using action url. but all the examples i found also creates menu in sidebar in addition to controller action.
For example this one: https://www.maximehuran.fr/en/admin-controller-creation-with-magento-2/
Is there any way to access controller action without creating menu?
Edit: After some modification to code, I can get into the controller using below URL:
my_backend_url/route_id/controller_name/index
but it redirects back me to Dashboard page.
As mentioned in this article:
Magento 2 Custom Admin Action Redirected to Dashboard
It's Secret Form Key issue.
We can get Secret form key only if we add controller to menu which i don't want to do!
Disabling Secret Form key is not what i prefer!