Magento – How to get correct ajax url for backend

backendurl

I am trying to make an ajax call to reload the information on the category edit page.

I know the url I am trying to create is catalog_category/edit, but $this->getUrl('catalog_category/edit') returns catalog_category/index.

Why is it returning index instead of edit? How do I get the correct url for ajax calls? Or do I need to manually specify the full url, in which case what is the best way to get the form key?

Best Answer

URL params should be in the form of route name (from config xpath) + controller path + action. Try

$this->getUrl('adminhtml/catalog_category/edit')

or

Mage::helper('adminhtml')->getUrl('adminhtml/catalog_category/edit')`