如何在JavaScript中识别Sys.UI._Timer?

时间:2019-02-14 00:00:20

标签: javascript jquery asp.net .net

在我的网页源代码中,我有:

Sys.Application.add_init(function() {
    $create(Sys.UI._Timer, {"enabled":true,"interval":300000,"uniqueID":"timerMain"}, null, null, $get("timerMain"));
});

什么是Sys.UI._Timer?服务器端是.Net类吗?

1 个答案:

答案 0 :(得分:2)

axios.get('/someAPIpage/').then(response => { this.name = response.data[0].name; this.a1 = response.data[0].1; this.a2 = response.data[0].2; this.a3 = response.data[0].3; this.a4 = response.data[0].4; }); 是类似于System.Web.UI.Timer服务器控件的类,但在客户端(使用JS)中运行,该类使用AJAX客户端库创建计时器控件。该类的默认构造函数定义如下所示:

& certutil -v -privatekey certificate.pfx | ? {$_ -match "^PFX protected password: ""(?<password>.*)""$"} | % { $matches.password }

请注意,$create是静态方法Sys.Component.create的简写,静态方法创建(并初始化)具有指定类型作为参数的组件(在本例中为Sys.UI._Timer)。您要设置为组件属性的属性值必须以JSON格式提供,并且使用以下语法给出属性名称用法(不包含下划线(因此Sys.UI._Timer = function Sys$UI$_Timer(element) { Sys.UI._Timer.initializeBase(this,[element]); this._interval = 60000; // Interval property, measured in milliseconds this._enabled = true; // Enabled property this._uniqueID = null; // UniqueID property // client-side only properties this._postbackPending = false; this._raiseTickDelegate = null; this._endRequestHandlerDelegate = null; this._timer = null; this._pageRequestManager = null; } 变为Sys.UI._Timer

_interval

进一步阅读:

Sys.UI._Timer - ASP.NET AJAX Client Library

Sys.UI Namespace - MS Docs