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
Joe NagyJoe Nagy 

visualforce page to another visualforce page on botton click

I want the button below to navigate to a new visualforce page within the same frame. When I click the button I receive Invalid Regular Expression Flags in the inspect element dialog on the browser. The controller and vfp code segments are below:
VisualForce Page:

<button class="slds-button slds-button_icon slds-float_none slds-button_icon slds-button_icon-small" title="Edit this Field" action="{!gotoPage}">

or

<button class="slds-button slds-button_icon slds-float_none slds-button_icon slds-button_icon-small" title="Edit this Field" onclick="{!gotoPage}">

Contorller:

public class PricingRequest{
      public pagereference getgotoPage()
    {
        pagereference pr = Page.TestPage2;
        return pr;
        
        }
}
Jayanth ThathapudiJayanth Thathapudi
Hi Joe ,

Please replace the method as below.

  public pagereference getgotoPage()   {
       pagereference pr = Page.TestPage2;
      pr.setRedirect(true);
       return pr;
       
  }

Regards
Jay