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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:25:02+00:00 2026-06-18T03:25:02+00:00

Framework 4.0 Asp.net application When I run the code I got a error The

  • 0

Framework 4.0 Asp.net application

When I run the code I got a error “The value ‘999.9999’ of the MaximumValue property of ‘RangeValidator’ cannot be converted to type ‘Currency’.

Below is my code:

<asp:RangeValidator Runat='server' ControlToValidate='textEdit' 
    MinimumValue='0.0001'
    MaximumValue='999.9999' Type='Currency' 
    ErrorMessage='Should be between 0.0001 and 999.9999' id="idValidtor" 
 display='None' />

Please explain me is currency value can’t contain more than 2 digits after decimal?
Unless how can I resolve this issue?

  • 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-18T03:25:04+00:00Added an answer on June 18, 2026 at 3:25 am

    The RangeValidator uses the NumberFormatInfo.CurrencyDecimalDigits property to determine if the string can be converted to a currency, otherwise it will throw your exception. From MSDN:

    when a RangeValidator control’s Type property is set to
    “Currency”, the MinimumValue and MaximumValue properties must be
    provided in a format such as that described in
    NumberFormatInfo.CurrencyDecimalDigits, otherwise an exception is
    thrown
    .

    The default for most cultures (incl. InvariantCulture) is 2 (arabic countries have 3 but none 4).

    So what culture are you using? If it is important to store more decimal places than two in a currency, then you could use a custom NumberFormatInfo in this page:

    protected void Page_PreInit(object sender, EventArgs e)
    {
        var customCulture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
        var nfi = (NumberFormatInfo)customCulture.NumberFormat.Clone();
        nfi.CurrencyDecimalDigits = 4;
        customCulture.NumberFormat = nfi;
        System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;
    }
    

    (note that you need to add using System.Globalization; at the top)

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

Sidebar

Related Questions

I am developing a ASP.NET MVC 3 application, i am using entity framework code
I have asp.net application and am using Entity Framework to connect it with the
I am building as asp.net application on .net framework 4.0 and I will be
I'm trying to create ASP.NET MVC Application with Entity Framework, which has One to
I have the following scenario. I have created an ASP.NET web application (framework 3.5)
For my ASP.NET MVC 2 application I use Entity Framework 1.0 as my data
In an ASP.NET MVC 4 application using the .NET 4.5 framework in conjunction with
I have an ASP.NET Dynamic Data application (using Entity Framework) in which I have
I am currently developing a web application in ASP.NET Framework 4 and I am
iam trying to run an application visual studio 2008.. got this error.. help me

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.