Create javaScript variable in code behind of asp.net

前端 未结 4 2157
不知归路
不知归路 2020-12-16 19:39

How do I register a Javascript variable on the server side (backend) and access it on the client side (Javascript file), without a hidden field, Literal, etc.?

4条回答
  •  情话喂你
    2020-12-16 19:50

    First place an tag in the of your .aspx file.

    Then in the server side code in your .aspx.cs file, do something like Literal1.Text = "" and you've got yout javascript variable called timer.

    That's it. Have fun!

提交回复
热议问题