I want to know what code do I need to save the data that JavaScript displays to SQL Database
I'm inside the Create View of my Controller. This is my code on the Create view that display my Javascript:
<div>
<script>
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
}
else { $("#message").html("Geolocation is not supported by this
browser."); }
function showPosition(position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
var latlon = "Latitude: " + latitude + "<br/>" + "Longitude: " +
longitude;
$("#message").html(latlon);
}
</script>
//This Display Latitude and Longitude
<p id="message"></p>
</div>
This code is Inside the Create.CSHTML file above its default code. It will show my current Latitude and Longitude values. I need to make it save those values in SQL