The DisplayNameFor()
generates pure text with the title of that element, while LabelFor
generates a tag label
of the HTML with the title text, like this:
<label for="Campo">Título</label>
What will appear on the page is the same, but the semantics within the page is very different. The second identifies what is on the page, the first is only meaningless text for the page / application.
That's why I say that you have to learn how it is and not how it appears. It's the same confusion people make about "working" and "being right," there's a lot of things wrong and it works, and people who learn wrong can not identify what's wrong because it feels right. But it just seems.
Thisisthebiggesttipyoucangetateverything.Whenthepersondoesnotseekthecorrectinformation,unliketheAPisdoingrightandseeking,livesineternal effect Dunning Krueger .
Both take the title determined by [DisplayName("")]
" in the template, or the field name if it does not have the specified annotation.
See also .