I dont have an Idea How to take latitude and longitude dynamically pls help me to solve..
Loading
I dont have an Idea How to take latitude and longitude dynamically pls help me to solve..
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Naimish MakwanaPosted Jun 2, 2023, 6:47 AM
To obtain the user's location dynamically in a C# web application, you can use the Geolocation API provided by modern web browsers and then send the latitude and longitude to your server-side C# code. Here's an example:
In your server-side C# code (e.g., ASP.NET MVC or ASP.NET Core), create a controller action to receive the latitude and longitude:
Or you can create your own method to get data to server.
Thanks
TarunPosted Jun 2, 2023, 6:17 AM
Hi Naimish Sir, will it work in my project (web application)
Naimish MakwanaPosted Jun 2, 2023, 5:57 AM
To obtain latitude and longitude dynamically in C#, you can use the Geolocation API provided by the .NET framework. Here's an example of how you can retrieve latitude and longitude using this API:
First, make sure you have the necessary NuGet package installed. In Visual Studio, right-click on your project, select "Manage NuGet Packages," search for "System.Device.Location," and install it.
Once you have the package installed, you can use the following code to obtain the latitude and longitude:
Thanks
TarunPosted Jun 2, 2023, 5:47 AM
i want in C# sir
Rajkiran SwainPosted Jun 2, 2023, 5:33 AM