how to pass the values by means of a button from one TextArea to another TextArea on the same page in ASP [closed]

0

how to pass the values by means of a button from one TextArea to another TextArea on the same page in ASP

    
asked by Dieguito Weed 11.09.2018 в 21:56
source

2 answers

0

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;
        }
    
answered by 11.09.2018 / 22:22
source
-1
      <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;
        }
    }
    
answered by 11.09.2018 в 22:47