Access C# variable in javascript file .js

后端 未结 3 1625
我寻月下人不归
我寻月下人不归 2021-01-19 05:08

Is it possible to create a javascript file with some C# variables? Something like this:

var foo =  <%= CODE_VALUE.foo %>;

Or do I hav

3条回答
  •  感情败类
    2021-01-19 05:33

    No you cannot use server side tags in .js files. Instead create the variables on the pages/controls where you need them.

提交回复
热议问题