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

  • SEARCH
  • Home
  • 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 7950997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:25:53+00:00 2026-06-04T02:25:53+00:00

I created a ViewModel object that has a decimal field containing a price. When

  • 0

I created a ViewModel object that has a decimal field containing a price. When I post that to my controller, this is what happens:

  • Enter “15” -> ok! Controller receives 15.
  • Enter “15.00” -> not ok! Controller receives a ‘null’ field.
  • Enter “15,00” -> validation error because the field should be formatted with a period (I just stick to one formatting type to avoid complexity for the time being).
  • Enter “15.00M” -> validation error, probably because it’s not considered to be a number.

How do I fix this? I want “15.00” to be a correct value, but I can’t figure out how to do this. I tried a couple of custom modelbinders that I found on the interweb, but they didn’t work.

  • 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-04T02:25:55+00:00Added an answer on June 4, 2026 at 2:25 am

    Easiest way to fix this is to pin the language in the web.config file:

    <globalization culture="en-us" uiCulture="en-us" />
    

    you have to place this one in the <system.web> node.

    Why is it the easiest? This way the included JavaScript helpers can do validation without problems (which is done by assuming that numbers should be US formatted values), which is now (due to our changes) the same on the server. Therefore something that is valid on the client side will also be valid on the server side (statement only valid for simple cases and JavaScript enabled browsers).

    All other options involve more editing, extending and knowledge about localization in MVC 3.

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

Sidebar

Related Questions

My problem is hydrating a Viewmodel from a Linq2Sql object that has been returned
I'm retrieving data from another database that has already created unique IDs for each
if i have created a view model and have a partial form that is
I've created a property IsLoading for my main view model. The idea is that
Created an OpenGraph action and object. Trying to submit my action. When I click
I'm having some trouble getting my ViewModel to return a non-null object in the
OK so I have a strongly-typed Customer Details view that takes a Customer object
I have a simple application that has a single page with a button that
I'm having an issue with a field being validated that seemingly is failing validation,
I obviously don't get this somewhere. I have created a UserControl, the bare bones

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.