Hello everyone,
I am very new to asp.net and asp.net mvc as well. I am stuck with the following problem please help. I have the following javascript
<script type="text/javascript">
var allMarks = [];
google.load("maps", "2");
var geocoder;
var lat;
function initialize() {
var map = new google.maps.Map2(document.getElementById("map"));
map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 10);
map.setUIToDefault();
GEvent.addListener(map, "click", function (overlay, latlng) {
if (latlng) {
var marker = new GMarker(latlng);
allMarks.push(latlng);
map.addOverlay(marker);
marker.openInfoWindow(latlng.toString());
lat = latlng.toString();
}
});
geocoder = new google.maps.Geocoder();
}
google.setOnLoadCallback(initialize);
</script>
Now how can i pass lat variable value in javascript to my asp.net mvc actionresult method in the controller. The method is like
public ActionResult GetValues(string Latitude)
{
//Get the value from javascript, process the value here
}
Thank you