【问题标题】:Correct Syntax in Client Template to add Actionlink along with conditional statement客户端模板中的正确语法以添加 Actionlink 和条件语句
【发布时间】:2016-07-08 04:16:34
【问题描述】:

我尝试了多次尝试添加 html.actionlink 以及剑道网格中客户端模板中的条件。可以请任何人帮助正确的语法。 谢谢。

col.Bound(o => o.IsEmpolymentFileExist).ClientTemplate("# if( IsEmpolymentFileExist == true) { # @Html.ActionLink("OpenFile", "Openfile", "PreEmploymentWorkflow", new { Id = "#=PreEmploymentId#", uploadfilename = "Employment Application" }, new { @class = "classname3" }).ToHtmlString() # } else {# <img ... /> # } #")

【问题讨论】:

    标签: asp.net-mvc-4 model-view-controller kendo-grid kendo-asp.net-mvc


    【解决方案1】:

    您需要将模板语法用引号括起来,然后是操作链接,然后是最终模板语法:“... template ...” + @Html.Actionlink(...)。 ToHtmlString() + "...模板...",所以试试:

    .ClientTemplate("# if( IsEmpolymentFileExist == true) { #" + @Html.ActionLink("OpenFile", "Openfile", "PreEmploymentWorkflow", new { Id = "#=PreEmploymentId#", uploadfilename = "Employment Application" }, new { @class = "classname3" }).ToHtmlString() + "# } else {# <img ... /> # } #")
    

    不确定{# &lt;img ... /&gt; # } 是否也需要在散列中。

    【讨论】:

      猜你喜欢
      • 2014-03-11
      • 1970-01-01
      • 1970-01-01
      • 2019-10-05
      • 1970-01-01
      • 2015-05-14
      • 1970-01-01
      • 2013-02-05
      • 1970-01-01
      相关资源
      最近更新 更多