Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Copy Data from One Text Box to Another

Author  Topic 

vk18
Posting Yak Master

146 Posts

Posted - 2007-03-21 : 13:03:24
Hi,
I have 2 Text Boxes and One Copy Button on a form. What ever entered in the Text box 1 need to be copied to Text Box 2 when i click on the Copy Button. Can you help me with that.
I am using VB.NET/ASP.NET
Thx

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-03-21 : 14:16:41
On the copy action, can't you just use TextBox2.Text = TextBox1.Text?

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2007-03-21 : 16:23:20
Hi,

I already tried this, but it doesn't work


quote:
Originally posted by tkizer

On the copy action, can't you just use TextBox2.Text = TextBox1.Text?

Tara Kizer
http://weblogs.sqlteam.com/tarad/

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-03-21 : 16:28:11
Explain what "it doesn't work" means as I can't read your mind.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2007-03-21 : 18:14:01
I added the code in the Copy Action "TextBox2.Text = TextBox1.Text"

when i click on the copy button then the text box is getting cleared.
Thanks


quote:
Originally posted by tkizer

Explain what "it doesn't work" means as I can't read your mind.

Tara Kizer
http://weblogs.sqlteam.com/tarad/

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-03-21 : 18:15:52
Post your code.


Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2007-03-22 : 14:00:20
Hi,
Take a look at this
Thx

Private Sub txtcopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtcopy.Click
txtaddress1.Text = txtbilladdress1.Text
End Sub


quote:
Originally posted by tkizer

Post your code.


Tara Kizer
http://weblogs.sqlteam.com/tarad/

Go to Top of Page

Easwar
Yak Posting Veteran

59 Posts

Posted - 2007-03-23 : 04:17:12
That coding is correct.......

otherwise

you use session.

In asp.net

session["t1"]=textbox1.text;

textbox2.text=session["t1"];
Go to Top of Page
   

- Advertisement -