Hello friends, In this tutorial, You are going to see How to Pass Parameter from Visualforce Page to another. This is a very common situation for any web application to Pass data from one Page to another Page.

How to Pass Parameter from One Visualforce Page to another

Create a Visualforce Page called FistPage.vfp from where you will pass the value to the second Visualforce Page


<apex:page controller="FirstPageController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:pageBlockSectionItem >Enter the text to be passed: <apex:inputText value="{!sValue}"/></apex:pageBlockSectionItem>
<apex:pageBlockButtons >
<apex:commandButton value="Go to Next Page" action="{!CallNextPage}"/>

Create an Apex class called FirstPageController.


public class FirstPageController {
public String sValue{get;set;} 
public FirstPageController()
public PageReference CallNextPage()
PageReference pg=new PageReference('/apex/SecondPage');
return pg;

Create a second Visualforce Page which will receive the parameter passed from fist Visualforce Page.


<apex:page controller="SecondPageController" >
The received value is {!sValue}

Create an apex class called SecondPageController.


public class SecondPageController {
public String sValue{get;set;}
public SecondPageController()


Pass Parameter

Click on the Go to Next Page.

Pass Parameter

View More:


I hope this is a useful topic for you. Please comment for any technical help. Your feedback and suggestions would be appreciated.

Thank You.

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, bool given in C:\inetpub\vhosts\debugonweb.com\httpdocs\wp-includes\wp-db.php on line 3353