In Development
Last Updated: 02 Sep 2025 10:03 by ADMIN
Bill
Created on: 02 Sep 2025 09:39
Category: Form
Type: Bug Report
1
The Form ignores the [Display(Name = "Value")] Data Annotation attribute

Bug report

The Form ignores the [Display(Name = "Value")] Data Annotation attribute:
telerik/kendo-ui-core#6503

Reproduction of the problem

The Email Label should read "Message":
https://netcorerepl.telerik.com/wzuDulvO14AtS2vC17

1 comment
ADMIN
Alexander
Posted on: 02 Sep 2025 10:03

Hi Bill,

The reported issue has to be related with the fact that the current implementation of the Form suggests that the DataAnnotations should retrieved from Controller -> View layer via the "ModelMetadataProvider".

To provide more context, the ModelMetadataProvider serves as the glue between your model definitions and the ASP.NET Core framework's ability to:

  • Generate UI elements automatically
  • Perform model validation
  • Handle model binding
  • Support data annotations

However, in order for the Razor View Engine to intercept the inclusion of such a Model and provide a way to perform an expedition for the whole model and its composite constructs - via notorious abstractions, it must be directly injected within the View.

For instance:

public class HomeController : Controller
{
    public IActionResult Index()
    {
        return View(new EmployeeViewModel());
    }
}

This tells the Controller-View engine layers:

"Hey, I have an incoming model, set it to the related property, and afterward synchronize it with a ModelExplorer that will later provide MetaData for each of the properties".

    Here is a more visual illustration:

    Bottom line is that the behavior is expected, as without that Model provided in the first glance that framework will not be to effectively take in the information for other aspects of a given properties - such as an attribute.

    However, since the MVC counterpart does not exhibit such behavior, we will try to eradicate the abnormality within the Telerik UI for ASP.NET Core ecosystem, provided that the framework enables us to do so.

    Kind Regards,
    Alexander
    Progress Telerik

    Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

    Attached Files: