how to get previous page variable value in asp .net using C#

 

If we want to get value of variable from previous page in current page then we use PreviousPage class to access controls of previous page instead of using classic Request object.

 

For Example..

If you want to get previous page TextBox value in current page then code should like..

TextBox textBoxTemp = (TextBox) PreviousPage.FindControl(“TextBox1″);
TextBox1.Text = textBoxTemp.Text;

 

We can also use session or Querystring to access variable but when ever we need to get value only in current page from previous page then above method will be best to use it..