0
jQuery的功能,所以我有这个jQuery功能Fireing与计时器滴答
function lbviewmore_click() {
erAlert();
}
我想,如果在一定时间之后被解雇,所以我创造了这个。
protected void Page_Load(object sender, EventArgs e)
{
alerts = DBExecute("exec testingt ", cs);
System.Timers.Timer aTimer = new System.Timers.Timer();
aTimer.Enabled = true;
aTimer.Elapsed += new ElapsedEventHandler(timer_Tick);
aTimer.Start();
}
protected void rawr()
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "blah", "lbviewmore_click();", true);
}
private void timer_Tick(object source, ElapsedEventArgs e)
{
rawr();
alerts2 = DBExecute("exec testingt ", cs);
if (alerts.Count == alerts2.Count)
{
}
else
{
}
//this.ClientScript.RegisterStartupScript(this.GetType(), "test", "lbviewmore_click()", true);
//System.Timers.Timer aTimer = new System.Timers.Timer();
//aTimer.Elapsed += new ElapsedEventHandler(timer_Tick);
//aTimer.Interval = 1000;
//aTimer.Enabled = true;
}
如果我将clientscript放在button_click中,它会运行。但我想在其他部分。任何帮助将不胜感激。
您是否希望在某段时间后弹出该按钮,无论该按钮是否被点击?..?如果是这样,那么从这里开始或做一个谷歌搜索如何自动弹出警报时,没有在网页上的活动.. http://forums.asp.net/t/1899214.aspx?If+no+activity+for+ 15 +分钟+显示+一个+提醒+ + +网页+ + +然后+任一+继续+或+注销 – MethodMan
约定的要求很差,你为什么混合使用c#asp.net和jquery,似乎很奇怪...你正在努力做什么......你在问这个问题之前是否至少做了一些搜索 – Seabizkit
我不想点击按钮。当我把“rawr();”到页面加载jquery运行良好,或者如果我把它放在一个按钮。但我希望这个jquery每25秒运行一次。我现在将它设置为5秒进行测试。它也会出现在其他语言中,但又是为了测试它是否在if语句之外。 – KratosMafia