简体   繁体   English

Page_Load事件中的异步用户控件加载

[英]Async User Control load in Page_Load event

I have a page that consist of 4 user control that each one load in a tab. 我有一个包含4个用户控件的页面,每个用户控件都在一个选项卡中加载。 one of this user controls show bing map based on our data to users. 此用户控件之一将根据我们的数据向用户显示bing地图。 The problem is that the Page_Load of our page is dependent to internet connection of users. 问题在于我们页面的Page_Load取决于用户的Internet连接。 How can we load this user control asynchronously? 我们如何异步加载此用户控件?

While it's not clear from your post the nature of the long running task that you think can benefit from changing it to asynchronous, I think you'll find good clues to "asynchronous UserControls" in this SO question 尽管从您的帖子中尚不清楚长期运行任务的性质,您认为可以从将其更改为异步中受益,但我认为您会在此SO问题中找到“异步UserControls”的良好线索

Also, the article Using Asynchronous Methods in ASP.NET 4.5 is an "official" tutorial that shows how to spin asynchronous processing at a more granular level. 另外,文章“ 在ASP.NET 4.5中使用异步方法 ”是一个“官方”教程,它显示了如何在更细粒度的级别上旋转异步处理。

I am curious to see some code for my own selfish learning goals, if you can share. 如果可以共享,我很好奇看到一些代码可以实现我自己的自私学习目标。

Could you clarify how Page_Load is dependent on Internet Connection? 您能否阐明Page_Load如何依赖Internet连接?

Please check following link, which shows how to load user control asynchronously: 请检查以下链接,该链接显示了如何异步加载用户控件:

Load User Control Asynchronously 异步加载用户控件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM