问题描述:

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.

网友答案:

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")
相关阅读:
Top