I’m making an asp.net app using visual studio 2010. I have a text field and button that calls a method on the String in the text field.
Enter your address here: <asp:TextBox ID="tb_address" runat="server" ></asp:TextBox>
<asp:Button Text="Submit" runat="server" onclick="GetLatLong" ></asp:Button>
In the C# file for the button, I have my GetLatLong method:
protected void GetLatLong(object sender, EventArgs e)
{
String address = tb_address.Text;
String query = "http://maps.googleapis.com/maps/api/geocode/xml?address=";
address = address.Replace(" ", "+");
query += address + "&sensor=false";
XmlDocument xDoc = new XmlDocument();
xDoc.Load(query);
String lat = xDoc.SelectSingleNode("/GeocodeResponse/result/geometry/location/lat").InnerText;
String lon = xDoc.SelectSingleNode("/GeocodeResponse/result/geometry/location/lng").InnerText;
}
How can I get my lat and lon Strings to display on my html page?
Use
<asp:Label />s.