none
Pass Values between aspx pages RRS feed

  • Question

  • Hi,

    I would like to know what is the best practice, to pass values between aspx pages..

    I have a error with my code:

    on page 1, in a button, i have :

    Page.Server.Transfer(

    "page2.aspx");

    on page 2, in a load method , i have :

    if (Page.PreviousPage != null){

    Label1.Text = ((

    TextBox)Page.PreviousPage.FindControl("TextBox1")).text;

    }

    Wednesday, August 29, 2012 6:10 PM

Answers

  • Hello, one way is to use session variable

    Session["field1"] = "value1";

    This link provides different ways to pass data between asp.net pages.

    HTH


    please Mark as the Answer, If this answers your question. If this post is helpful, please vote as helpful.



    Wednesday, August 29, 2012 6:15 PM