Here I have created sample that Pass the Data from one Page to another. In this Form1 takes Name and Message after click Edit Button It Shows the greeting with Name and Message on Form2 Page
Form1:
public Form1()
{
InitializeComponent();
}
private void btnEdit_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2(this.txtName.Text.Trim(), this.txtMessage.Text.Trim());
form2.Show();
}
Form2:
string name;
string message;
public Form2()
{
InitializeComponent();
}
public Form2(string name, string message)
{
this.name = name;
this.message = message;
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
this.lblMessage.Text = "Hi " + name + "Your Message is " + message;
}