Friday, January 23, 2015

Invalid anonymous type member declarator MVC

I got this error message when i use  @data-group in ActionLink.

@Html.ActionLink(cardCategory.Name, "Index", new { controller = "Home" }, new { @class = "btn btn-default btn-lg btn-filter", @data-group = "C" })

Use an underscore _ - the Razor engine is smart enough to translate that to a data- attribute.

No comments:

Post a Comment

I Built a New Kind of Number Puzzle Game (And You Can Play It Free)

 For a long time, I wanted to play a mobile puzzle game that felt genuinely strategic—something that required real brainpower, skipped the a...