954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Pass values from one aspx page textbox to another aspx page textbox

Good day, I need help.

I would like to pass values from one aspx page textbox to another aspx page textbox.

I'm editing the pages & adding code (so no clue what i'm doing) i thought of javascript but no luck on passing the value to the next pages textbox.

On the 1st aspx page textbox1 onclick button go to another aspx page passing the value of the 1st Page Textbox1 = 2nd Page Textbox2

Page1 Apsx

Page2 Aspx

Please assist & provide code to send & define the var for second page

Regards

ismailc
Newbie Poster
6 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

Hi,
You can do it using sessions.

in the first page add the textbox1 value to a session variable in the onclick event

session["tb1"]=textbox1.value;

in the second page assign the value in the session variable to textbox2 in Page_Load

textbox2.value=session["tb1"];

u dont need to pass the value to the second page and place runat="server" in the input tags.


thankyou

praveenkumarm
Newbie Poster
19 posts since Aug 2009
Reputation Points: 10
Solved Threads: 2
 

Thanks for assisitng but i'm not working in the application, i think VS2005 C#.

My page looks like:

ismailc
Newbie Poster
6 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

ismailc,

Use bb code tag when post a source code. See # icon at top of post editor.

Correction to @pravinkumar's post,

in the second page assign the value in the session variable to textbox2 in Page_Load textbox2.value=session["tb1"];

Check the availability of an object,

if(Session["tb1"]!=null) {
     TextBox2.Text=Session["tb1"].ToString();
  }
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Apologies, I'm lost.

The code provided does not work in my page syntax.
I'm editing the aspx page in notepad.

Please assist, Regards

ismailc
Newbie Poster
6 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You