CHtml::ajaxLink or CHtml::ajaxButton only works for the first time?

Hi guys,

I am stuck on this problem.

The ajaxbutton only works for the first time.

view file:

<div id='current-user'>


            $this->renderPartial( '_user', array(

                   'user' => $user, 



_user file:


    <li><?php echo $user->name; ?></li>



     echo CHtml::ajaxLink( 'next',  array( 'user/next',  'userid'=>$user->id, 'rand'=>rand(1, 1000) ), array(  'update' => '#current-user', 



the controllerAction:

public function actionNext($userid)



       $newUser = User::model()->findByPk($userid);

       $this->renderPartial( '_user', array( 




Any advice are appreciated.

thanks in advance for your help

$this->renderPartial( '_user', array(

                   'user' => $user, 

            ), false, true); 

There are lots of topics covering this situation. read through the forum.

Thanks a lot, it works.

Could you please tell some keywords about this situation.

read this

and post your questions if you don’t understand anything but it should be straight forward. Also it is good practice to search the forum before you post. I almost always find the answer to my questions that way