A webpage currently gives a device ID with hyphens in the number, I want to replace -
with :
instead (that is to say, replace any hyphens with a colon), but only at display time. I'm pretty confident this is line that is generating the device ID shown on the page:
@Html.DisplayFor(Function(m) m.DeviceID)</span> <br />
Is it possible to change this output to include colons instead?
You can create a display template. Create the following partial view
~/Views/Shared/DisplayTemplates/_DeviceWithColons.cshtml
:Now in your View, specify:
You can then later reuse this display template where required.