【问题标题】:Telerik Kendo MVC UI - ClientFooterTemplate ViewBag valueTelerik Kendo MVC UI - ClientFooterTemplate ViewBag 值
【发布时间】:2016-01-23 20:45:14
【问题描述】:

我正在尝试将 ViewBag 的值放入 ClientFooterTemplate 中,如下所示:

ClientFooterTemplate("<div style='#= (average > 'ViewBag.FBGLG') ? 'color: \\#FF0000;' : '' #'>#:average#</div>");

不工作?

检查我使用的模板:

ClientFooterTemplate("<div style='#= (average > 7) ? 'color: \\#FF0000;' : '' #'>#:average#</div>");

效果很好。

我试过了:

#=ViewBag.FBGLG'# , '@ViewBag.FBGLG', and ViewBag.FBGLG. 

没有成功!!

非常感谢您的建议。

【问题讨论】:

    标签: asp.net-mvc telerik client-templates


    【解决方案1】:

    你能试试这个“ViewBag.FBGLG”吗?

    【讨论】:

    • 不能在客户端模板中使用双引号。
    【解决方案2】:

    我从 Telerik Support 那里得到了答案,以防万一其他人遇到同样的问题: 应该是

    (average > "+ ViewBag.FBGLG +")
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-09
      相关资源
      最近更新 更多