abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.87k stars 3.43k forks source link

DataAnnotations not effective #15410

Closed elitesw closed 1 year ago

elitesw commented 1 year ago

Is there an existing issue for this?

Description

In blazor wasm mode, data annotations not effective. The culture has been set to zh-Hans. Call the API from Swagger and the return is correct.

test01

test02

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Regression?

No response

Known Workarounds

No response

Version

6.02

User Interface

Blazor

Database Provider

EF Core (Default)

Tiered or separate authentication server

Tiered

Operation System

Windows (Default)

Other information

No response

realLiangshiwei commented 1 year ago

It looks like you are using a third-party UI, please open an issue on the relevant repo.

elitesw commented 1 year ago

Thank you for your reply! It should not be the reason for the third-party UI. I tried to use the built-in EditForm and ValidationSummary tag, and the display is the same. The validation error text is the content defined by the AbpValidationResource. I found that there is an AbpDataAnnotationsLocalizationOptions configuration option in MVC mode. There is no similar in Blazor. test03

realLiangshiwei commented 1 year ago

Please use the official template to reproduce this problem