简体   繁体   English

执行后台SQL查询,然后用值更新LinkBut​​ton

[英]Executing background SQL query then update LinkButton with value

Currently I have a ASP.NET web form loading and on the page load, I have a sql query that gets some data. 当前,我有一个ASP.NET Web表单加载,在页面加载中,我有一个获取一些数据的sql查询。 The problem is, the sql query is a rather complicated one and it takes upwards of 20-40 secs sometimes to gather the data. 问题是,sql查询是一个相当复杂的查询,有时需要20到40秒以上才能收集数据。 This prevents my page from loading quickly. 这样可以防止我的页面快速加载。 I would like to find a solution to load the bare bones of the page with default values and run the sql query in a seperate thread. 我想找到一种解决方案,以默认值加载页面的裸露骨骼,并在单独的线程中运行sql查询。 Once the query returns the data, I would like to then change the text of some linkbuttons to represent some of the data from the sql dataset. 查询返回数据后,我想更改一些链接按钮的文本,以表示sql数据集中的某些数据。 Any suggestions or pointing me to another post would be helpful. 任何建议或将我指向其他职位都将有所帮助。 Also, example code can be either VB or C#. 同样,示例代码可以是VB或C#。

在这种情况下,最好在页面加载后使用@RyanWilson建议的内容进行异步调用,然后在查询返回数据后更新页面。

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

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