Is it possible to use razor syntax in Javascript files?

后端 未结 3 1614
既然无缘
既然无缘 2021-01-05 08:58

I\'d like to use razor syntax inside my Javascript files. Is this possible without including the javascript inline into the page?

3条回答
  •  失恋的感觉
    2021-01-05 09:12

    You can set the value in hidden field in yout cshtml file , and then in your javascript files you can access the hidden field.

提交回复
热议问题