【问题标题】:DataAnnotations Displayname("Some thing here") and using italics, possible?DataAnnotations Display Name("Something here") 并使用斜体,可能吗?
【发布时间】:2010-11-24 13:02:07
【问题描述】:

正如标题所示,我有:

DisplayName("This is the display name")
int Id {get;set;}

我想用斜体设置这个名字的一部分。

DisplayName("This is the <i>display name</i>")
int Id {get;set;}

但是这正在被清理并且 HTML 没有被使用。有没有办法解决这个问题?

我不能将斜体放在视图本身上,因为我只希望显示名称的一部分斜体。

干杯,
可汗

【问题讨论】:

    标签: asp.net-mvc viewmodel data-annotations


    【解决方案1】:

    您必须创建自己的 Custom Template。然后您就可以完全控制正在呈现的 HTML。

    【讨论】:

      猜你喜欢
      • 2011-07-10
      • 2012-07-24
      • 2011-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-23
      • 1970-01-01
      相关资源
      最近更新 更多