Click here to Skip to main content
15,914,222 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can i parse the value of the variable latlong from the following JavaScript on my C# program?

function showPosition(position) {
var latlon=position.coords.latitude+"||"+position.coords.longitude;
}

What I have tried:

I have already tried to use Jurassic Engine but it doesn't support navigation
Posted
Updated 11-Aug-17 8:13am

1 solution

You can code it to store the latlon into a hidden element. Example.

On the aspx page, add a hidden field

ASP.NET
<asp:HiddenField ID="HiddenField1" runat="server" />


Then add the JavaScript

JavaScript
function showPosition(position) {
   var latlon=position.coords.latitude+"||"+position.coords.longitude;
   document.getElementById("<%=HiddenField1.ClientID%>").value = latlon;
}


Then in the code behind, access the hidden field value
C#
var x = HiddenField1.Value;
 
Share this answer
 
Comments
Karthik_Mahalingam 16-Aug-17 3:37am    
5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900