Hi
I have a gooleMap Control and 4 control TextBox(latitude, longitude, address, country). I let 4 controls TextBox, in the UpdatePanel.
When i click on the Map, in the GMap_Click handler, i modify the text in the 4 control, but it dont show up. The Code is like this:
<
asp:UpdatePanel Id="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
<table> <tr><td>Address</td><td>
<asp:TextBox id="TbAddress1" Width="300px" runat="server" AutoPostBack="true"/>
</td>
</tr>
<tr><td>Country</td><td>
<asp:TextBox AutoPostBack="true" runat="server" id="TbCountry1" maxlength="25" />
</td>
</tr>
<tr>
<td>Latitude</td>
<td>
<asp:TextBox id="TbLatitude1" AutoPostBack="true" maxlength="25" runat="server"/>
</td>
</tr>
<tr>
<td>Longitude</td>
<td>
<asp:TextBox runat="server" id="TbLongitude1" maxlength="25" AutoPostBack="true"/>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnAdd" runat="server" Text="Add" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>
<Reimers:GoogleMap ID="GMap" Width="500px" Height="300px" runat="server" />
</td>
</tr>
</table>
void
GMap_Click(object sender, CoordinatesEventArgs e)
{
GoogleMarker gm1 = new GoogleMarker("Marker "+j.Next(), e.Coordinates.Latitude, e.Coordinates.Longitude);
e.MapCommand = e.Map.AddOverlay(gm1,
true);
TbLatitude1.Text = e.Coordinates.Latitude.ToString();
TbLongitude1.Text = e.Coordinates.Longitude.ToString();
GoogleResult result = GoogleGeocoder.ReverseGeocode(e.Coordinates, ((GoogleMap)FindControl("GMap")).GoogleKey);
string address = null;
string country = null;
foreach (Location loc in result.Locations)
{
address = loc.Address.Street +
" " + loc.Address.Zip + " " + loc.Address.City + " " + loc.Address.Region;
country = loc.Address.Country;
break;
}
TbCountry1.Text = country;
TbAddress1.Text = address;
}
Do someone know how to make the change show up in the text Box?
Best Regard