transfer of data between forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sarvari
    New Member
    • Dec 2007
    • 1

    transfer of data between forms

    hii, i am doing a web application ..in first form i have a textbox (txtplotno) and a button (get) ..in second form i need to display all the details of the plotno which is given in first form.my quesion is:

    how to send the (plotno) textbox data to the second form to display the details?

    plese help me..
    thanks in advance
  • dip_developer
    Recognized Expert Contributor
    • Aug 2006
    • 648

    #2
    Originally posted by sarvari
    hii, i am doing a web application ..in first form i have a textbox (txtplotno) and a button (get) ..in second form i need to display all the details of the plotno which is given in first form.my quesion is:

    how to send the (plotno) textbox data to the second form to display the details?

    plese help me..
    thanks in advance
    store the plotno in a Session variable...you can access it in the other page....

    Otherwise you can use Querystring to pass your information across pages.

    if you dont know about Querystring or Session then use GOOGLE

    besides these two other methods are there also......

    Comment

    • saintleo
      New Member
      • Dec 2007
      • 2

      #3
      Hi Sarvari,

      Explaining further on dip_developers reply, using a session variable is as easy as this:

      Code:
      Session["variableName"] = textBox1.Text;
      It should be noted though that session variables use precious server resources. An alternative, in case the user reaches the second form from the first, you could dynamically generate a link to redirect the user to the second form with the value from your text box as a query string value.

      Code:
      Response.Redirect("form2.aspx?variableName=" + textBox1.Text);

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        You need to store the value from the textbox in a session variable.

        Comment

        Working...