To open new page from current page using APEX

To open new page from current page using APEX

The below code is used to open new page ‘AddAllBlog’ from current page.

Apex Code:

  public PageReference skip()
  {  
  PageReference pg = new PageReference(‘/apex/AddAllBlog’);
  pg.setRedirect(true);
  return pg;  
  }

If you give URL as ‘http://google.com’ instead of ‘/apex/AddAllBlog’, it will open google website.

Leave a Reply