how to pass the values by means of a button from one TextArea to another TextArea on the same page in ASP
how to pass the values by means of a button from one TextArea to another TextArea on the same page in ASP
In the Html you have this:
<textarea runat="server" id="textarea1"></textarea>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
<textarea runat="server" id="textarea2"></textarea>
on the server this:
protected void Button1_Click(object sender, EventArgs e)
{
textarea1.Value = textarea2.Value;
}
<asp:TextBox id="TextArea1" TextMode="multiline" Columns="50" Rows="5" runat="server" ViewStateMode="Enabled" />
<asp:TextBox id="TextBox2" TextMode="multiline" Columns="50" Rows="5" runat="server" ViewStateMode="Enabled" />
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click1" />
and the code-behind side
protected void Button1_Click1(object sender, EventArgs e) { if (!string.IsNullOrEmpty(TextArea1.Text)) { TextBox2.Text = TextArea1.Text; } }