StaftBitBub
New Member
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:\[code\]<asp:TextBox ID="txtMachIP" runat="server" CssClass="Textbox1"></asp:TextBox> <asp:Button ID="BtnGetIP" runat="server" CssClass="btn1" onclick="BtnGetIP_Click" Text="Get My IP" />\[/code\]This is my backend code for getting the ip:\[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\]Instead of the message box, I want my IP to be displayed in the text area.