Razor variable into Javascript

后端 未结 1 605
暗喜
暗喜 2020-12-19 18:51

I am trying to set a JavaScript variable from a model variable using Razor, and can\'t figure out what is wrong. In the CSHTML page, I\'ve tried the following ways:

1条回答
  •  生来不讨喜
    2020-12-19 19:25

    If you need to set a variable to a string literal, then it needs to be enclosed in quotes. For example:

    
    

    0 讨论(0)
提交回复
热议问题