【问题标题】:Convert the syntax of razor @ to ASPX <%: %>将razor @的语法转换为ASPX <%: %>
【发布时间】:2013-01-18 15:30:10
【问题描述】:

我需要知道 Razor 和 ASPX 语法是否都正确

剃须刀:

columns.Template(@<text>@Html.ActionLink("Create Facility", "Facility")</text>)

网络表单:

columns.Template(<%: <text><%:Html.ActionLink("Create Facility", "Facility") %> </text> %>)

【问题讨论】:

    标签: .net razor asp.net-mvc-4


    【解决方案1】:

    您的 Razor 代码看起来不错:

    columns.Template(@<text>@Html.ActionLink("Create Facility", "Facility")</text>)
    

    WebForms 需要更多意大利面条式代码:

    columns.Template(c => { %> <%= Html.ActionLink("Create Facility", "Facility") %> <% })
    

    【讨论】:

    • 我正在为 ASP MVC4 使用 Kendo Grid
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-28
    • 2012-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多