I need a blank page to receive a post of ajax and return json.
If I run the code below any page of backend, the link opens a blank page, that set up on my controller and router.
<?php echo Mage::helper('adminhtml')->getUrl('installments/adminhtml_ajax/'); ?>
But if I run into any page of the frontend, the key of the url is not the same and I am directed to the dashboard.
I do not know how to get the correct URL for the frontend, someone would have an idea that works?
Examples:
Backend = installments/adminhtml_ajax/index/key/000085c50c4882df8a9cae52c8392227/
Frontend = installments/adminhtml_ajax/index/key/99edadac5bc5bb1e2421d3be38db525e/
Routers
<frontend>
 <routers>
 <installments>
 <use>admin</use>
 <args>
 <module>Dexxtz_Installments</module>
 <frontName>installments</frontName>
 </args>
 </installments> 
 </routers>
</frontend>
<admin>
 <routers>
 <installments>
 <use>admin</use>
 <args>
 <module>Dexxtz_Installments</module>
 <frontName>installments</frontName>
 </args>
 </installments>
 </routers>
</admin>
Already changed the frontend for standard and nothing has changed.
- 
 Can you add your config.xml to your question?MagePal Extensions– MagePal Extensions2014年12月17日 20:42:03 +00:00Commented Dec 17, 2014 at 20:42
- 
 Added routers @R.SDexxtz– Dexxtz2014年12月18日 10:23:16 +00:00Commented Dec 18, 2014 at 10:23
2 Answers 2
The key in the url is generated based on the admin session.
And you cannot share the admin and frontend sessions, that's why when making the call from the frontend you get a different session key. 
Anyway, it's not a good practice to make calls to backend actions from the frontend.
You should have 2 separate controllers, one for backend and one for frontend.
In order not to duplicate the code, you can put everything inside a method in a helper and just call that method in both controllers.
Your front and admin <routers> (<frontName>installments</frontName>) should not be the same.
They are two ways to configure admin modules
1) Given it a different front name
 <admin>
 <routers>
 <installments>
 <use>admin</use>
 <args>
 <module>Dexxtz_Installments</module>
 <frontName>admin_installments</frontName>
2) Put your module before/after adminhtml
<admin>
 <routers>
 <adminhtml>
 <args>
 <modules>
 <Company_Adminhtml before="Mage_Adminhtml">Company_Adminhtml</Company_Adminhtml>