function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ganta gadbadganta gadbad 

I HAVE A VF page say VFPage1 .Now I've a button on VFpage1 ,clicking on thr button should open a VFPage2 within the same page but not as a seperate window.Amy help would be apprecaiated

logontokartiklogontokartik
Do you have a Controller Class for VFPage1? If yes, you can bind your button call the method in the controller that returns VFPage2 as pageReference. 
 
public pageReference buttonClick(){
   
   Pagereference newPage = new Pagereference('/apex/VFPage2');
    newPage.setRedirect(true);
    return newPage;
 
}



If you use just a regular HTML Button use _target attribute.. with value as parent or self.

http://www.w3schools.com/tags/att_a_target.asp