Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Validation Error with datatype Double #11032


User avatar
0
moonch created

Product version: Asp Net Core, JQuery, .NET 6

Dear Customer Support. I amd getting Validation errors with Double and Decimal values when culture is not English:

Abp.Runtime.Validation.AbpValidationException: Method arguments are not valid!

For example if the cuture is set for Arabic, and for DataTypes Double we try to post a value 1.5 , this throws an error 500, the Value 1.5 is not valid, same is Ok for Whole Numbers, so for example 1.0 does not throw this error.

I looked into the forum and i found this thread from three years ago, where this issue was raised and it was mentioned that it was Fixed in 1.7.2 release. However in my project, I am using latest zero version I am still getting the error.

[Forum Link](https://support.aspnetzero.com/QA/Questions/6318/ValidationError-with-datatype-Double)


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @moonch

    Did you generate the form which posts this data by Power Tools or on your own ? If you created the form, could you share your project via email with [email protected] ?

    Thanks,

  • User Avatar
    0
    moonch created

    Dear Ismcagdas I did not generate the form using Power Tools, I have created the form.

    I sent you email titled: Ticket Number #11032

    Please let me know if you have any issues accessing the files. Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @moonch

    Thanks, we got the project and will check it soon and inform you.

  • User Avatar
    0
    moonch created

    Dear Ismcagdas Any Update on this ticket.

    Thank you.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @moonch

    We tried same with non-kendo components and it worked. Is it possible for oyu to confirm this ?

    Thanks,

  • User Avatar
    0
    moonch created

    Dear ismcagdas,

    In the file I sent you there are two methods , One AddWithKendo and the Other IsAddWithoutKendo, Both methods fail to recieve the decimal values, it does not matter if the input is masked by kendo or not, the data fail to bind even when i use html <input type number> instead of kendo numeric html helper, Please see attached image.

    One Note: the ZIP File Asp-zero_OlderVersion is actualy my project (.NET6) , Sorry this was renaming mistake, Please Try to un-zip this project Asp-zero_OlderVersion and debug it.

    Thank you.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It seems like this is related to form getting values with a wrong separator when you call $("form").submit();. You can follow two approaches here.

    1. You can manually get values of input fields and replace "." with "," and send to server.
    2. You can create a helper classes similar to https://stackoverflow.com/a/45914737