If you use ASP.NET WebForms, you can add a Click event handler to the button to set the text of the text field:
protected void Button1_Click(object sender, EventArgs e) { MyTextBox.Text = "Text to display"; }
You can use autowireup to get the event handler connected to this button, or explicitly assign the event handler to the event in the Page_Load () method.
The easiest way to assign an event to a button is to declare it in .aspx code, for example:
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
This will be done automatically if you double-click this button in design mode.
Michael shimmins
source share