更新时间:2023-01-07 08:36:50
数据图标
不是一个有效的C#变量名。你可以得到最接近的是这样的:
data-icon
is not a valid C# variable name. The closest you could get is this:
<%: Html.ActionLink(
"Delete",
"Delete",
new { id = Model.ID },
new Dictionary<string, string> { { "data-icon", "ui-icon-trash" } }
) %>
当然,这个问题一直在 ASP.NET MVC 3 解决,你不再需要编写意大利面条code。所以:
Of course this issue has been addressed in ASP.NET MVC 3 and you no longer need to write spaghetti code. So:
<%: Html.ActionLink(
"Delete",
"Delete",
new { id = Model.ID },
new { data_icon, "ui-icon-trash" }
) %>
以及下划线的将被自动转换为的连字符的