Howto Make Ajaxlink Pass A Linkbutton?


With ajaxlink i’m picking which item i want to proceed with…

I then want the controller to update my div id with a linkbutton.

My code:

echo CHtml::ajaxLink(

  CHtml::image($data->imageUrl, $data->step1Name, array("style"=>"width: 80px; height: 70px; border: 1px;")),

  Yii::app()->createUrl( '/fs/ajaxRequest' ),










    'href' => Yii::app()->createUrl( '/fs/ajaxRequest' ),

    'class' => 'link',





<div id="proceed_button"><?php echo CHtml::submitButton('Proceed', array('class'=>'btn','disabled'=>'disabled')); ?></div>

My controller then looks like this:

public function actionAjaxRequest() {

  if($_POST['step'] == 'step1'){

    Yii::app()->session['step1'] = $_POST['id'];

    echo CHtml::linkButton('Proceed', array('submit'=>array('goto'),'params'=>array('redirect'=>'step2','id'=>$_POST['id']),'class'=>'btn link8'));




This way, it will only echo the linkbutton, but not the actual jquery where the actual link is posted…

How can i accomplish this?

(i dont want to use a normal "link" if i can be without…


// Casper


I guess you should move your [font=“Courier New”]echo …[/font] into a partial view, which you’ll have to render using [font=“Courier New”]$processOutput = true[/font]

See here: