Problem With Renderpartial + Registerscript

I’m working with one controller and one view. In my controller i am using a renderPartial function to render my “search” view. In my “search” view i have a respective script (using registerScript function) that works for search data with ajax. But the javascript code does not appear in the source code (browser). If i create another view and call the function renderPartial inside this view and point to the “search” view, the javascript code appears. Someone know why i can’t see my javascript code (and the function doens’t work) when i’m using the function renderPartial inside the controller and the registerScript in the view?

Dear Friend

Did you call the function in the following way?




$this->renderPartial("yourView",$data,false,true);//the last parameter "true" ensures that view is rendered along with scripts.



Yes, The last param, should be true which is by default a false.