Grizzly
Grizzly

Reputation: 5943

String in Razor is display wrong

I have this razor syntax:

@Html.DisplayName("T.F.C")

However, when I run this, only the letter 'C' appears. I have looked up escape characters and ASCII codes, and I can't seem to get it to work.

any help is appreciated. Thanks.

Upvotes: 0

Views: 28

Answers (1)

user5993582
user5993582

Reputation:

Razor engine ignore all chars (or string) before last ".", Then If use @Html.DisplayName("TF.C"), You see "C". If use @Html.DisplayName("T.FC"), You see "FC".

If you want display "T.F.C", you can use

@Html.Label("lblLabel","T.F.C")

Upvotes: 1

Related Questions