Skip to content

DisplayForTagHelper

StrutTower edited this page Nov 11, 2022 · 1 revision

Tag helper that works like @Html.DisplayFor()

Usage

<span display-for="Property"></span>

<span display-for="@Variable"></span>

<span display-for="Date" template="NameOfDisplayTemplate"></span>

<span display-for="Property" append="true">content</span>

Attributes

Name Required Data Type Description
display-for Required ModelExpression Property to show the value for
template Optional String Name of the DisplayTemplate to use
append Optional Boolean (default false) Sets if the displayed text should be added after any content already in the element

Valid Elements

  • div
  • span
  • a
  • abbr
  • p
  • em
  • strong
  • th
  • td
  • h1
  • h2
  • h3
  • h4
  • h5
  • h6
  • li
  • option
  • breadcrumb-item (Currently has an issue on items with a link)

Clone this wiki locally