Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MVC] When inserting a decimal in the Razor view, I got the number without decimal in the viewmodel #17

Open
advapiIT opened this issue Oct 27, 2022 · 1 comment

Comments

@advapiIT
Copy link

I got an application I migrated from 5.3.4 -> 6 and I realized that when I type 20.1 in the input field, I got 201 in the ViewModel.
I created a new project from scratch and it works... I really don't understand what can be gone wrong

 public class CreateMetalloViewModel
        {
            [Required]
            [StringLength(128)]
            public string Metallo { get; set; }

            [Required]
            [Display(Name ="Euro)]
            public float Euro{ get; set; }
        }

here I got 201 for Item.Euro

    public async Task<IActionResult> OnPostAsync()
        {
            var dto = ObjectMapper.Map<CreateMetalloViewModel, CreateOrUpdateAnagraficaMetalloDto>(Item);
            await _anagraficaMetalloAppService.CreateAsync(dto);
            return NoContent();
        }

And the form is really simple

<abp-dynamic-form abp-model="Item" asp-page="/Anagrafiche/Metalli/CreateModal">
    <abp-modal>
        <abp-modal-header title="Aggiungi nuovo metallo"></abp-modal-header>
        <abp-modal-body>
            <abp-form-content />
        </abp-modal-body>
        <abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
    </abp-modal>
</abp-dynamic-form>

Any suggestion?

@ismcagdas
Copy link
Member

I created a new project from scratch and it works...

Is this a raw ASP.NET Core project or an ABP based project ? By the way, probably this is not related to LeptonX theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants