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 :

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

Something like

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

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

1
2
3
4
5
6
7
8
9
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);
       },
   });