Skip to main content Trailblazer Community 在 2025-2-1 至 2025-2-2 之间将不可访问。请相应地安排您的活动。
Hello Everyone,

I had an issue with Commandbutton which I need to redirect the page from the Visualforce page to some other company Website Contact Us page.

Here is my CommandButton code and Controller class code.

VF Page CommandButton:

 <apex:commandButton style="color:white; background-color:red; background-image:none; width:150px; height:35px" action="{!Cancel}" value="Cancel"  />

Controller Class:

 public PageReference Cancel(){

        PageReference pr = new PageReference('/www.bren.com/residential/contact');

        pr.setRedirect(true);

        return pr;

    }

Please help me with this issue.

Thanks and Regards,

Azar Khasim.
2 个回答
  1. 2019年12月13日 06:02
    Hello Maharajan,

    Thank you it's working,

    Actually, I have tried the same way yesterday, but it didn't work at that time.

    Anyway thanks for your help Mr. Maharajan.

    Thanks and regards,

    Azar Khasim.
0/9000