You must Sign In to post a response.
  • Category: ASP.NET

    HOw to Find geo location in using JavaScript

    Hi, Developers ,
    i am creating a webapplication.Now i need to find the location by select the dropdoen list selected value.
    If i selected chennai on the dropdown list it display the message Chennai.

    So please help me to how i am done this task Please.

    Thanking you with
  • #764994

    1. We have lot of API regarding the Geolocation.
    2. API's are very simple. You can send some simple JSON String to get the details.

    You can refer the following link for more details about the API availability.

    The requirement which you posted is not very clear.
    As per my understanding, I can give you some tips.

    1. You can populate the drop down list from the database
    2. Onchange of the dropdown you can call javascript.
    3. In the java script you can make Jquery ajax call for the Google API.(you can use simple json string for input)
    4. Once you get the result you and deserialize/parse the json and populate the data in the you web page

    By Nathan
    Direction is important than speed

  • #764997
    Thanks for your valuable reply mr.nathan

    By Paul.S

  • #764998
    Do you want select city automatically in your dropdownlist ?
    You can submit the IP you receive to an online geolocation service, see below sample<your ip here>&jsoncallback=<suitable javascript function in your source>, then including the source it returns which will run the function you specify in jsoncallback with the geolocation information.
    Alternatively, you may want to look into HTML5's geolocation features, that I have not tried
    or use below link

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

Sign In to post your comments