【问题标题】:How to pass a span tag with id and class in MVCContrib grid如何在 MVCContrib 网格中传递带有 id 和类的 span 标签
【发布时间】:2011-09-20 23:31:25
【问题描述】:

在我的应用程序中,我有一个名为“cmets”的列,因为我想将字符重新限制为 54,然后用省略号附加它(即我真的很喜欢你的产品......)并在 .. . 在工具提示上显示整个文本。

当我使用代码时

column.For(a => ( ((a.Comments.Length > 54) ? (a.Comments.Substring(0, 53) + MvcHtmlString.Create("...").ToHtmlString()): MvcHtmlString.Create(a.Comments).ToHtmlString( ))

        )).HeaderAttributes(width => "40%").Named("Comment");

它打印 Span id=".. 也将其作为文本。

有什么方法可以让文本中的跨度呈现为 HTML 吗??

【问题讨论】:

    标签: mvccontrib mvccontrib-grid


    【解决方案1】:

    我没用过qtip,但是一般如果你想在mvccontrib网格中使用html,你使用 .DoNotEncode().

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-02-16
      • 1970-01-01
      • 2021-03-25
      • 1970-01-01
      • 2021-07-26
      • 1970-01-01
      • 2022-08-11
      相关资源
      最近更新 更多