【发布时间】:2012-02-08 15:55:21
【问题描述】:
我正在尝试将附加属性 data-icon 添加到我的操作链接,但出现以下错误:
匿名类型成员声明器无效。匿名类型成员必须 使用成员分配、简单名称或成员访问来声明。
作品:
@Html.ActionLink("Profile", "Details", "Profile", new { id = 11 },
new { @rel = "external", @id = "btnProfile" })
例外:
@Html.ActionLink("Profile", "Details", "Profile", new { id = 11 },
new { @rel = "external", @id = "btnProfile", @data-icon = "gear" })
【问题讨论】:
-
而不是
@data-icon使用@data_icon -
给出同样的例外
标签: asp.net-mvc-3 c#-4.0 razor