How to open another Visualforce page from current Visualforce page in Salesforce?

Sample Code:

Visualforce page:

<apex:page controller="sample">
            <apex:commandButton value="Open" action="{!openPage}"/>   

Apex Class: 

public class sample
    public pageReference openPage()
        pageReference pg = new pageReference('/apex/Name_Of_The_Page');
        return pg;

No comments:

Post a Comment

Sharing is Caring!!! Share this with your friends!!!

submit to reddit