手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >asp.net在事件中启动线程来打开一个页面的实现方法
asp.net在事件中启动线程来打开一个页面的实现方法
摘要:在页面点击一个按钮,其目的是在按钮中做两件事情,一件需要点击按钮马上完成,另一件事情是点击按钮后做其他事情。如果按顺序一次做完感觉特别耗时,...

在页面点击一个按钮,其目的是在按钮中做两件事情,一件需要点击按钮马上完成,另一件事情是点击按钮后做其他事情。如果按顺序一次做完感觉特别耗时,下面简单罗列一下。

protected void Button1_Click(object sender, EventArgs e) { Label1.Text = TextBox1.Text; //在这做第一件事情 dowork(); //做完后马上启动线程 System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(ThreadChild)); thread.Start(); }

线程中处理完后打开一个窗口

public void ThreadChild() { Label2.Text = DateTime.Now.ToString(); //Response.Write(""); //响应http必然报错 //Response.Write("<script>window.open('login.aspx','','');</script>"); //通过注册即可打开窗口 Page.RegisterStartupScript("", "<script>window.open('login.aspx','','');</script>"); }

【asp.net在事件中启动线程来打开一个页面的实现方法】相关文章:

asp.net中List的使用方法

asp.net 备份和恢复数据库的方法

asp.net中IDataParameter调用存储过程的实现方法

asp.net跳转页面的三种方法比较

asp.net2.0中css失效的解决方法

asp.net动态添加js文件调用到网页的方法

asp.net中包含文件的代码及使用方法

asp.net access添加返回自递增id的实现方法第1/3页

asp.net 参数不同共用一个页面的实现方法

asp.net错误捕获page_error事件使用方法

精品推荐
分类导航