Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..I have two text boxes and a button control.I am entering a sentence in first text box than click on button control then the sentence goes to second text box(now first text box should b clear) but now when i am entering next sentence in first text box and click on button then i want to add this sentence from new line after first sentence.
Posted
Updated 6-Jan-12 0:32am
v3

Try this,

XML
<asp:TextBox ID="Txt_First" runat="server"></asp:TextBox>
<asp:TextBox ID="Txt_Second" runat="server" Width="280px" TextMode="MultiLine"></asp:TextBox>
<asp:Button ID="Button5" runat="server" onclick="Button5_Click" Text="Button" />



C#
protected void Button5_Click(object sender, EventArgs e)
   {
       string text = (Txt_Second.Text) + "\r\n" + Txt_First.Text;
       Txt_First.Text = "";
       Txt_Second.Text = text;
   }
 
Share this answer
 
v2
Comments
mayankshrivastava 6-Jan-12 7:17am    
Thanks Supriya..........
it works....
Supriya Srivastav 6-Jan-12 7:18am    
Welcome...
Extract the text from the second text box and append the new data to it.
 
Share this answer
 
Dear Shrivathsava,

Set textbox multiline boolean property to True, It will solve your problem

for better understanding check this link

http://www.dotnetperls.com/textbox[^]

Thanks
 
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