我想实现延迟5秒弹出窗口,可以下面的代码不能实现,请大大看看
        //add by lzw 2013-3-25  如果选择了自动发邮件时,这执行弹窗
        if (IsAutoSendEmail)
        {
            //Thread.Sleep(2000);
            //string msg = string.Format("<script>ShowEmailDialogPage(" + this.RowID + ")</script>");
            Thread t = new Thread(new ThreadStart(theout));
           
            t.Start();
            ShowComfirmInfo();
            
            //Page.RegisterStartupScript("success", msg);
        }
    }
    public void theout()
    {
        Thread.Sleep(2000);
        string msg = "<script>ShowEmailDialogPage(" + this.RowID + ");</script>";
        
        ClientScript.RegisterStartupScript(this.GetType(), "success", msg);
        
    }
              
                  延迟弹窗
              
------解决方案--------------------使用定时器把
------解决方案--------------------建议用定时器
------解决方案--------------------你是延迟2秒注册的javascript啊,貌似加载的时候才能注册进来,因为你启动另一个线程后延迟2秒,那时候页面已经加载到客户端了。
还是立即加载,也不用多线程,就是用定时器。
------解决方案--------------------不用在C#里写
string msg = "<script>setTimeout(ShowEmailDialogPage(" + this.RowID + "),2000);</script>";
直接用setTimeout