Razor/JavaScript and trailing semicolon

前端 未结 7 1034
不知归路
不知归路 2020-12-01 11:30

Using Visual Studio 2012, on a Razor view page, in the JavaScript section, I am getting what I think is a battle between Razor syntax vs JavaScript syntax. In particular, th

7条回答
  •  醉酒成梦
    2020-12-01 12:06

    
    

    Isn't it as simple as wrapping in parentheses? Putting values through the console seem to work fine with no side effect.

    It works for strings, but it still gives the error for non-quoted values, but I still like this for string values. For numbers you could just use parseInt('@Model.TotalResultCount', 10).

提交回复
热议问题