What's the point of Html.DisplayTextFor()?

前端 未结 3 616
情话喂你
情话喂你 2020-12-28 11:59

Is there a good reason to use the strongly typed html helper...

<%: Html.DisplayTextFor(model => model.Email) %>

As opposed to...

3条回答
  •  清歌不尽
    2020-12-28 12:46

    DisplayTextFor will also get called during "DisplayFor" and "EditFor" execution. This will ensure that any templated helpers will display the text using the correct Templated Helpers if set ... so a change to the single templated helper will propogate through all displays of that text item ... simple display, edit form, create forms etc etc.

提交回复
热议问题