在页面中应用多线程 [英] Apply Multithreading in the page

查看:72
本文介绍了在页面中应用多线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个包含20个iframe的页面.在我的项目中,我有10个Web窗体,例如Form1.aspx,Form2.aspx,...到Form10.aspx.我已将源form1设置为前10个iframe(iframe1至iframe10)属性的形式10.类似地,我将剩余的iframe(Iframe 11至Iframe20)分配为form1到Form 10.我在每个Web表单中都保持一个会话值.会话值将为CC或FD.我必须根据会话值加载网络表单.我已经尝试过使用querstring.我的要求失败了.然后,我想到了使用线程.您能否建议如何将会话值CC用作第一个线程,将FD用作第二个线程?

Hi
I have a page which contains 20 iframes. In my project, I have 10 webforms like Form1.aspx, Form2.aspx, ... to Form10.aspx. I have given source form1 to form 10 for the first 10 iframes(iframe1 to iframe10) attribute. Similarly i assigned form1 to form 10 to rest of the iframes(Iframe 11 to Iframe20). I am maintaining the one session value in each webforms. Session value will be CC or FD. I have to load the webform based on the session value. I have been tried using querstring. it is failed in my requirement. Then, I thought of use thread. Can you please suggest how to use session value CC as the first thread and FD for the second thread?

推荐答案

我不确定您的要求正在推动20 iframe,但听起来有点吓人! ;)

如果要尝试加快加载时间,请记住,浏览器对服务器的并发请求数量受到限制,因此线程化"并不是真正的答案.

您可以执行以下操作:
1)在播放该空格的每个元素中都有一个占位符(请在此处 [
I am not sure what your requirements are that are driving 20 iframes, but it sounds a little scary! ;)

If you''re trying to speed up the load times, keep in mind that you are limited by the number of simultaneous requests to the server by the browser, so ''threading'' isn''t really going to be the answer.

What you can do is this:
1) Have a placeholder in each element that is playing the space (go here[^]).
2) Have hidden form values on your page that give you the values you need to load the appropriate pages.
3) Use JavaScript (or a library like jQuery) to load the content into each of the frames via AJAX.

The end result is that the user will see that the browser is working to get the pages and the pages will load as the content comes down.

Hope this helps some.

Cheers.


这篇关于在页面中应用多线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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