Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to put the "Display Name" in a label on a Blazor page?

$
0
0

I have the following model:

class User{    [Display(Name = "Display Name")]    public string Name { get; set; }}

In standard Razor I would do something like the following to get the "Display Name":

<label asp-for="Model.Name"></label>

but that doesn't seem to work in Blazor. Does anyone know how to get the display name in a Blazor page without using reflection?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>