Magento link in backend redirect to dashboard

You are working on Magento backoffice and make a link to a new page but when you click on your anchor, you are redirected to the dashboard ?

Here how to make a proper link :

   echo "<a href='".Mage::helper('adminhtml')->getUrl('*/*/displaydetail', array('id' => $cour['id']))."' >".$cour['name']."</a>";

Something like

 Mage::getUrl('*/*/displaydetail/id/'.$cour['id'])

doesn’t work, even if I had the FormKey. But you can use it for ajax request

 jQuery.ajax({
        url: "<?php echo Mage::getUrl('*/*/classroomfromplaceAjax') ?>",
        type: "POST",
        dataType: 'json',
        data: 'place_id=' + place_id + '&index=' + index + '&form_key=' + window.FORM_KEY,
        success: function (data) {
            jQuery('#classroom_' + index).html(data.html);
        },
    });

Leave a Reply