我正在将 C# 中生成的值传递给我的 Javascript 函数,例如 -
C#
protected int Month;
protected int Day;
protected int Minute;
protected int Hour;
// set these later in code
象素
function test() {
Month: '<%= Month%>'
Day: '<%= Day%>'
Minute: '<%= Minute%>'
Hour: '<%= Hour%>'
然而,当各种控件被点击时页面重新加载,这些变量被重置为空。有没有办法可以保留这些值,以便它们在重新加载时不会丢失?