1

I have a situations when I trying to display bool? value. In case if my bool doesn't exist:

@Html.DisplayFor(m => m.HasType)

Shows text "Not set". By itself it is fine, but I need show another text. How can I replace "Not set", for example with "Empty"?

I could just do something like:

@if (!Model.HasType.HasValue)
{
   ...
}
else
{
   ...
}

But I want to know, is there a possibility to change "Not set" itself.

P.S Sorry for my bad english.

Olegs Jasjko
  • 2,128
  • 6
  • 27
  • 47
  • 5
    you can use **Template** see [here](http://stackoverflow.com/a/6878320/1849444) – teo van kot Nov 27 '14 at 10:06
  • Yes just looked at the source code and you cannot override the "Not Set" used by the default template. You will need to create your own template as @teovankot says. – Rhumborl Nov 27 '14 at 10:10

0 Answers0