Sample Code:
Visualforce page:
Visualforce page:
<apex:page controller=”sample”>
<apex:commandButton value=”Open” action=”{!openPage}”/>
</apex:page>
Apex Class:
public class sample
{
public pageReference openPage()
{
pageReference pg = new pageReference(‘/apex/Name_Of_The_Page’);
pg.setRedirect(true);
return pg;
}
}