isAjaxRequest returns wrong value

I am creating the link like that:

echo CHtml::ajaxLink('Create new', $this->createUrl('Admin/Section', array('new'=>'1')), array('update'=>'#form'));

in the Admin controller when I check Yii::app()->request->isAjaxRequest it is always false. Any Ideas why ?

I'm using NuSphere PHPed and its internal webserver for development and debugging, is it possible this to be the problem ?

Quote

I'm using NuSphere PHPed and its internal webserver for development and debugging, is it possible this to be the problem ?

You should check if the $_SERVER['HTTP_X_REQUESTED_WITH'] super-global is correctly set by you webserver, otherwise it wont work.

I've checked it, and its not set correctly. It is null. Does anyone know how to work around this issue ?

Quote

I've checked it, and its not set correctly. It is null. Does anyone know how to work around this issue ?

Maybe you could add some special get parameter to your ajax request ('isAjax'=>true for example) and check if it is set in your related controller.

Well, in my production system there is not such problem, but that’s makes debuggin while development harder and annoying. May be I’ll install local apache with debuggin extension on my comp and will stop using the internal server(it’s very convinient though :( ) or i’ll set extra get parameter like @juban suggested.