Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8964301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:33:26+00:00 2026-06-15T16:33:26+00:00

I am trying to persist geolocation data gotten by the google.maps.Geocoder(). From javascript I

  • 0

I am trying to persist geolocation data gotten by the google.maps.Geocoder().
From javascript I set the values into an (actually) hidden element in html (which is working fine):

document.getElementById("longitude").value = results[0].geometry.location.lng();
document.getElementById("latitude").value = results[0].geometry.location.lat();

From there I want to pass the values into the controller:

@Html.TextBoxFor(model => model.Longitude, new { id = "longitude", type = "number" })
@Html.TextBoxFor(model => model.Latitude, new { id = "latitude", type = "number"})

Depending on the decimal seperator I get either a validation error or the values for longitude and latitude are not set to the model. Both properties are type of long.

Why can’t Asp.Net parse the values automatically?
I am quite new to Asp.Net but I know I could else:

  • write my own html-helper
  • pass a view model into my controller or
  • persisting the string values

Which way should I prefer?

Thanks, Rico

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:33:27+00:00Added an answer on June 15, 2026 at 4:33 pm

    You’re getting errors because long stores large 64-bit integer values (it’s actually Int64 behind the scenes), not floating point values.

    If you want your code to work with floating point values, you’ll need to use something like float or double.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to persist some data that I get from a form in a
I am trying to persist an object into the database. This operation should touch
I'm trying to persist an object into the database using Cayenne Entity Manager. And
Trying to persist Guid's in a MySQL db from C# (.NET). MySQL column is
Im trying to persist some data but im getting an error here. Declaration of
I'm currently trying to persist a canvas to a bitmap, and I've run into
I'm trying to persist a set of what I would call relatively simple objects
I'm trying to persist an object into a MongoDB, using the following bit of
Am trying to determine the best way to persist information from an originating email,
I am trying to persist data across a perl CGI application (when a submit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.