Ajax not works in portlet

Hi,

I use portlet to display homepage with login that has forgotpassword link

on click this link i use ajax to display the result

but why ajax meets problem

how to set url? but when i use without portlet ie using views and controller ajax works

my opening url for this portlet is http://localhost/code/php/index

when i use without portlet suchas http://localhost/code/php/index.php?r=login/login it works

view is

<?php echo CHtml::link(‘Forgot Password?’,’#’,array(‘id’=>‘forgotpassword’,‘onclick’=>’$("#result").html("");’,‘style’=>‘color:yellow’));?>

<?php $urls=Yii::app()->request->url;

$script="

$(’#forgotpassword’).click(function(){

jQuery.ajax({

type:‘POST’,

url:’".$urls."&request=forgotpassword’, // i think this is the problem

cache:false,

‘data’:jQuery(this).parents(‘form’).serialize(),

success:function(html)

{

jQuery(’#passwordsend’).html(html);

},

});

return false;

});

";

Yii::app()->clientScript->registerScript(‘forgotpassword’, $script, CClientScript::POS_READY);

?>

and portlet is

class Login extends Portlet

{

protected function renderContent()


{


	&#036;form=new LoginForm;


	&#036;form-&gt;attributes=&#036;_POST['LoginForm'];


	if (Yii::app()-&gt;request-&gt;isAjaxRequest)


	{


		&#036;request=Yii::app()-&gt;request-&gt;getParam('request');


		if ('forgotpassword'==&#036;request)


		{


			if (&#33;empty(&#036;form-&gt;username))


			{


				&#036;user=User::model()-&gt;find('username=:username ',array(':username'=&gt;&#036;form-&gt;username));


				if (null&#33;=&#036;user)


				{


					&#036;subject=&quot;Password Rememberance&quot;;


					&#036;to=&#036;user-&gt;email;


					&#036;message=&quot;Password Rememberance for your Eprodigy account&#092;n&#092;nyour username : &quot;.&#036;user-&gt;username.&quot;&#092;nPassword : &quot;.base64_decode(&#036;user-&gt;password).&quot;&#092;n&#092;n&#092;nRegards&#092;nEprodigy Team&quot;;


					Yii::app()-&gt;mailer-&gt;Host = 'mail.prudencesolution.com';


					Yii::app()-&gt;mailer-&gt;IsSMTP();


					Yii::app()-&gt;mailer-&gt;From = 'rettaikulamram@gmail.com';


					Yii::app()-&gt;mailer-&gt;FromName = 'Eprodigy Team';


					Yii::app()-&gt;mailer-&gt;AddReplyTo('rettaikulamram@gmail.com');


					Yii::app()-&gt;mailer-&gt;AddAddress(&#036;to);


					Yii::app()-&gt;mailer-&gt;Subject = &#036;subject;


					Yii::app()-&gt;mailer-&gt;Body = &#036;message;


					if (Yii::app()-&gt;mailer-&gt;Send())


					echo &quot;&lt;font color='green'&gt;Password Remembering Successful&lt;br/&gt; Password Sended to your Emailaddress&lt;/font&gt;&quot;;


					else // with mailer error message eg. SMTP Error: Could not connect to SMTP host. Check Internet Connection&#33;


					echo &quot;&lt;font color='red'&gt;Password Remembering Unsuccessful&lt;br/&gt;Password not Sended to your Emailaddress&lt;/font&gt;&quot;;


				}


				else


				echo &quot;&lt;font color='red'&gt;Password Remembering Unsuccessful&lt;br/&gt;Invalid Username&lt;/font&gt;&quot;;


			}


			else


			echo &quot;&lt;font color='red'&gt;Password Remembering Unsuccessful&lt;br/&gt;Invalid Username&lt;/font&gt;&quot;;


		}


	}


	else


	{


		if (isset(&#036;_POST['login']))


		{


			


				&#036;identity=new UserIdentity(&#036;form-&gt;username,&#036;form-&gt;password);


				if(&#036;identity-&gt;authenticate())


				{


					//print &quot;welcome&quot;.&#036;form-&gt;username;


					Yii::app()-&gt;user-&gt;login(&#036;identity); // allow login to this user


					//&#036;this-&gt;refresh();


					&#036;this-&gt;controller-&gt;refresh();


					//&#036;this-&gt;redirect(array('Menu')); // show success message form


				}


				else


				yii::app()-&gt;user-&gt;setFlash('result','Login Unsuccessfully &lt;br/&gt;Invalid Username or Password');


			


		}


	


		&#036;this-&gt;render('login',array('form'=&gt;&#036;form));


	}





}

}

please help me

Could it be that, while this is a correct URL:


http://localhost/code/php/index.php?r=login/login&request=forgotpassword

This one is wrong, the "?" is missing.


http://localhost/code/php/index&request=forgotpassword

Best regards,

schmunk

Thank you