Click here to Skip to main content
15,903,385 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In asp.net how to get copy textbox values from one to another, using multiview control(i.e view 1 textbox to textbox view 4)..
Posted

If you hard-coded the textbox in the views then you can just call them by their variable name and set the text value from one to the other.

C#
oTextBox4.Text = oTextBox1.Text;


However, if you are doing this dynamically then you need to use the
FindControl(string controlid)
function.

C#
TextBox
    oTextBox1 = View1.FindControl("oTextBox1") as TextBox
    oTextBox4 = View4.FindControl("oTextBox4") as TextBox;
if((oTextBox1 != null) && (oTextBox4 != null))
    oTextBox4.Text = oTextBox1.Text;
 
Share this answer
 
answer is

TextBox4.Text=TextBox1.Text// how simple is that
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900