Visual Studio 2010 を使用して asp.net アプリを作成しています。テキスト フィールドの文字列のメソッドを呼び出すテキスト フィールドとボタンがあります。
Enter your address here: <asp:TextBox ID="tb_address" runat="server" ></asp:TextBox>
<asp:Button Text="Submit" runat="server" onclick="GetLatLong" ></asp:Button>
ボタンの C# ファイルには、GetLatLong メソッドがあります。
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;
}
緯度と経度の文字列を HTML ページに表示するにはどうすればよいですか?