how to copy the text box value to another textbox [Resolved]

Posted by Kishore22 under ASP.NET on 9/18/2013 | Points: 10 | Views : 1622 | Status : [Member] | Replies : 3
i want to copy the data in first textbox to second text box

and at the same time

i want to copy the selected value in dropdownlist1 to the dropdownlist 2 please explain with a sourcee code




Responses

Posted by: Allemahesh on: 9/18/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
Dear Kishore,

1. How to copy tha data from one text box to other.
Here is you code:-

private void textBox1_Leave(object sender, EventArgs e)

{
textBox2.Text = textBox1.Text;
}

private void textBox2_Enter(object sender, EventArgs e)
{
textBox2.Text = textBox1.Text;
}




2. How to copy the data from one dropdown list to another dropdown list?
Here is code:-

foreach (ListItem li in DrpList.Items)

{
DropDownList1.Items.Add(li);
}

Happy Coding
If it helps you or directs U towards the solution, MARK IT AS ANSWER

Kishore22, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Write2varun on: 9/18/2013 [Member] Starter | Points: 25

Up
0
Down
do you want to do it on button click event

Kishore22, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 9/18/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
Dear kishor,

If your problem is solved, then Click on MARK IT AS ANSWER link.

Happy Coding
If it helps you or directs U towards the solution, MARK IT AS ANSWER

Kishore22, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response