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 6586317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:46:33+00:00 2026-05-25T16:46:33+00:00

Looks like that JsonValueProviderFactory (from Microsoft.Web.Mvc) that I’m using in my ASP.NET MVC2 project

  • 0

Looks like that JsonValueProviderFactory (from Microsoft.Web.Mvc) that I’m using in my ASP.NET MVC2 project is culture specific.

I send this JSON from client:

{
   "name": "Max",
   "weight": "60.21" 
}

JsonValueProviderFactory converts JSON to this class:

public class User
{
    public string Name { get; set; }
    public double Weight { get; set; }
}

Everything works correctly if my current culture is CultureInfo.InvariantCulture. But if I explicitly set my culture to “ru-RU” User’s Weight value will be 0.0

Ok, I can send formatted value based on culture for weight from client, for example:

{
   "name": "Max",
   "weight": "1,100.21"    // it's just example, not my real weight :) 
}

But in this case JsonValueProviderFactory can’t parse weight and it will be zero, although double.Parse(“1,100.21”, CultureInfo.CurrentCulture) works correctly.

How I can resolve this problem?

  • 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-05-25T16:46:33+00:00Added an answer on May 25, 2026 at 4:46 pm

    If the weight property is supposed to be double, send it as such, not as string:

    var model = {
       "name": "Max",
       "weight": 60.21
    };
    
    $.ajax({
        url: '@Url.Action("someAction")',
        type: 'POST',
        contentType: 'application/json',
        data: JSON.stringify(model),
        success: function (result) {
            alert(result);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found some code in a project which looks like that : int main(int
I use Spring MVC [version: 2.5] and Security[version: 2.0.4]. My problem looks like that:
I'm using grid that looks like that: Html.Telerik().Grid(Model).Name(preciousGrid). ... bla bla bla.. .ClientEvents(events =>
I am running some tests on Selenium Web Driver. But looks like that I
I have a table that looks like this: Month Site Val 2009-12 Microsoft 10
I have searched the web but it looks like that it is not that
I have a JSON string (from PHP's json_encode() that looks like this: [{id: 1,
I was looking at the TableSearch example code from Apple. It looks like that
It looks like that Microsoft is backfiring again in VS2010. Here's my code #include
My db table looks like that. I'm trying to generate nav. menu from db

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.