如何在多行文本框中将两个或多个句子作为新行附加 [英] How to append two or more sentences as a new line in a multiline text box

查看:38
本文介绍了如何在多行文本框中将两个或多个句子作为新行附加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..我有两个文本框和一个按钮控件.我在第一个文本框中输入一个句子,而不是单击按钮控件,然后将该句子转到第二个文本框(现在第一个文本框应为b清除),但是现在我在第一个文本框中输入下一个句子,然后单击按钮,然后我想在第一个句子之后从新行中添加此句子.

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.

推荐答案

尝试一下,

Try this,

<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" />







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;
   }


从第二个文本框中提取文本并将新数据附加到其中.
Extract the text from the second text box and append the new data to it.


亲爱的Shrivathsava,

将文本框多行布尔属性设置为True,将解决您的问题

为了更好地了解,请检查此链接

http://www.dotnetperls.com/textbox [
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


这篇关于如何在多行文本框中将两个或多个句子作为新行附加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆