标签: javascript razor
我是asp.net mvc的新手。如何在剃须刀中编写javascript代码?
@foreach (var player in ViewBag.Players) { <script> team.member=@player.Name; </script> }
答案 0 :(得分:0)
将razor变量放在单引号中 -
team.member='@player.Name';