title: Display output in a textfield after a button click
body: <p>I'm using a button to get the IP address. I want to display that IP address in the text field.
  This is my front end code:</p>
  
  <pre><code>&lt;asp:TextBox ID="txtMachIP" runat="server" CssClass="Textbox1"&gt;&lt;/asp:TextBox&gt;
   &lt;asp:Button ID="BtnGetIP" runat="server" CssClass="btn1" 
                      onclick="BtnGetIP_Click" Text="Get My IP" /&gt;
  </code></pre>
  
  <p>This is my backend code for getting the ip:</p>
  
  <pre><code> protected void BtnGetIP_Click(object sender, EventArgs e)
  {
      string myHost = System.Net.Dns.GetHostName();
      System.Net.IPHostEntry myIPs = System.Net.Dns.GetHostEntry(myHost);
      foreach (System.Net.IPAddress myIP in myIPs.AddressList)
      {
          MessageBox.Show(myIP.ToString());
  
      }
  }
  </code></pre>
  
  <p>Instead of the message box, I want my IP to be displayed in the text area.</p>