Visual Studio confused by server code inside javascript

前端 未结 7 993
[愿得一人]
[愿得一人] 2021-01-11 19:00

I ran into an annoying problem: the following code gives a warning in Visual Studio.



        
7条回答
  •  感动是毒
    2021-01-11 19:43

    I can't believe how many responses say "Put the JavaScript in the code-behind instead". This is a very bad idea, and muddles your code by mixing presentation with business logic. As the original poster stated, this is only a mere warning. While annoying, it's not worth mixing your presenatational behavior in with your server-side code (a.k.a. writing poor code) over.

提交回复
热议问题