一个网页上可以有多个线程吗? [英] Is it possible to have more than one thread on single web page?

查看:126
本文介绍了一个网页上可以有多个线程吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的问题是:在C#4.0中的单个网页上是否可以有多个线程?

在这种情况下,我的.aspx页上有6个以上的按钮,每个按钮都将调用脚本,该脚本至少需要30分钟才能完成.因此,我将启动一个新线程和一个新会话,以在整个Shell脚本执行过程中显示进度弹出窗口.使用一个按钮可以正常工作,但是现在我必须为每个按钮使用相同的逻辑.因此,在一页上可以有多个线程和会话吗?

Hello All,

My question here is : Is it possible to have more than one thread on a single web-page in C# 4.0?

In this case , I have .aspx page having more than 6buttons on it , every button is going to call script which is taking at least 30mins to gets completed. so I am starting a new thread and new session to show progress pop-window during whole execution of shell script. It is working fine with use of one button but now I have to use same logic for every button. So Is it possible to have more than one thread and session on one page?

推荐答案

应该是.试试看.顺便说一句,如果用户离开页面(或关闭浏览器),网页上运行的线程会怎样?最好在Web服务中运行长时间的操作,或者与Web服务器上的Windows服务进行通信.
It should be. Try it and see. BTW, what happens to a thread running on a web page if the user navigates away from the page (or shuts down the browser)? It might be better to run your lengthy operation in a web service, or by communicating with a Windows service on the web server.


这篇关于一个网页上可以有多个线程吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆