将以下代码:
@(Html.BingMap().Credentials("{Bing Map Key}") .CenterAt("City Center, Redmond, Washington") .WithZoom(15) .WithPushpin("City Center, Redmond, Washington") .WithWidth("500px") .WithHeight("500px"))
改为:
@Html.BingMap().Credentials("{Bing Map Key}") .CenterAt("City Center, Redmond, Washington") .WithZoom(15) .WithPushpin("City Center, Redmond, Washington") .WithWidth("500px") .WithHeight("500px")
在Razor语法中,@(expression)用于在HTML中嵌入C#代码的结果,但在这种情况下,它并不是必需的。因此,将其删除即可解决问题。