I'm trying to pass the values in the textboxes below to a Javascript function (also below) on the button click of a ASP.net Button. I've been looking and can only find ways to it
on page load (<body onload="initialize()">)
Any Help will be appreciated!
on page load (<body onload="initialize()">)
Any Help will be appreciated!
VB.NET:
<script type='text/javascript'>
var map;
var directionsPanel;
var directions;
function initialize(Lat,lng,From) {
map = new GMap2(document.getElementById('map_canvas'));
map.setCenter(new GLatLng(lat,lng), 15);
directionsPanel = document.getElementById('route');
directions = new GDirections(map, directionsPanel);
directions.load('from:' + From + 'to:' + lat + ', ' + lng );
} </script>
<table>
<tr>
<td>
Lat:</td>
<td >
<asp:TextBox ID="txt" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td >
Lng:</td>
<td >
<asp:TextBox ID="txtlng" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td >
From Directions:</td>
<td >
<asp:TextBox ID="txtFrom" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td >
</td>
<td >
[COLOR="Red"] <asp:Button ID="Button1" runat="server" Text="Get Directions" />[/COLOR]</td>
</tr>
</table>
<div id="map_canvas" style="width: 70%; height: 480px; float: left; border: 1px solid black;">
</div>
<div id="route" style="width: 25%; height: 480px; float: right; border: 1px solid black;">
</div>