My problem is this:
They asked me not to put runat="server"
to textArea1
. Then in the part of the code the label does not appear to me. I tried to trap the tag with the master.findcontrol()
but it throws me a NullException
(Object reference not set as an instance of an object) and therefore does not pass the data to textArea2
<%: Title% >.
Your application description page.
Use this area to provide additional information.
<textarea id="TextArea1" cols="20" rows="10" ></textarea> <asp:Button ID="Button1" runat="server" Text="Pasar A" OnClick="Button1_Click"/> <textarea id="TextArea2" cols="20" rows="10" runat="server"></textarea> </asp:Content>
code Behind
public partial class About : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(Master.FindControl("TextArea1").ToString()))
{
TextArea2.InnerText = Master.FindControl("TextArea1").ToString();
}
}
}