Convert the syntax of razor @ to ASPX <%: %

2019-05-30 14:21发布

I need to know whether the Razor and ASPX syntax are both correct

Razor:

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

Web Forms:

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

1条回答
倾城 Initia
2楼-- · 2019-05-30 14:30

Your Razor code seems fine:

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

WebForms needs a little more spaghetti code:

columns.Template(c => { %> <%= Html.ActionLink("Create Facility", "Facility") %> <% })
查看更多
登录 后发表回答