ajax link and link not working as im expecting

Ok what I want to is to have a dialog form pop up .

the test dialog works with this link here


echo CHtml::link('open dialog', '#', array(

	'onclick'=>'$("#mydialog").dialog("open"); return false;',

      

));

but the minute i change it to an ajaxlink




echo CHtml::ajaxLink('open dialog', array('controller/action'), array(

	'onclick'=>'$("#mydialog").dialog("open"); return false;',

));



it stopped working as in it doesnt open the dialog anymore, is there something i should know that im doing wrong? why i want an ajaxlink is because i want to have multiple dialogs use one empty div, so I would have 2 different ajax links both performing some action and rendering different stuff but update the same div (only one link at a time of coarse). can some body please help me…

ok iv solved this i forgot that when using the ajaxLink the 3rd parameter becomes ajaxOptions and not htmlOptions anymore…