Hello I have a visualforce page integrated into opportunity layout. on button click it should redirect to another page. but the problem is on button click the page is redirecting with in layout but not whole.

enter image description here

  • use target="Blank" with button.
    – Reshma
    Nov 11, 2016 at 10:07
  • @Reshma nope, that wont work.
    – Srujan
    Nov 11, 2016 at 10:11

2 Answers 2


If your button is a javascript button the following should work

window.top.location.href = "http://www.example.com"; 

target="Blank" - this attribute is not available with commandbutton.

You can use a commandLink to redirect to another page and style it as a command button to do the trick like

 <apex:commandlink styleClass="btn" target="_blank">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.