Webform,加载,显示和处理大量数据 [英] Webform, load, show and work with huge amount of data

查看:86
本文介绍了Webform,加载,显示和处理大量数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我有一个大问题。我必须做一个加载大量信息的webform,大约3000条记录。

加载不是问题,我使用DataList和性能查询。在DataList中,我有一个动态生成的HTML表,里面有linkbutton触发一个处理信息并绘制行的事件。

之后,我会在几秒钟内显示信息。

问题是当我执行回发时,比如链接按钮或图像按钮,在代码隐藏进程后,页面加载了一段时间。



我如何解决这个问题?



我想修复用StringBuilder生成HTML表格并在更改事件表后重新处理表格。



有什么想法吗?



提前致谢。



对不起对于我的英语。

Hello, i have a big problem. I must to do a webform that load a lot of information, about 3000 records.
Load is not a problem, i''m use DataList and performance querys. In the DataList i have a HTML table dynamically generated with linkbutton inside that trigger an event that process information and paint the row.
After that, i''m show information within seconds.
The problem is when i do a postback, like a linkbutton or imagebutton, after the codebehind is process the page is loading for a while.

How I can fix this?

I thought fix that generanting the HTML table with a StringBuilder and reprocess the table after changing events table.

Any idea?

Thanks in advance.

Sorry for my English.

推荐答案

一个简单的原则是你永远不想在一个页面上显示真正的大量数据。



此外,您的用户也不会想要它。您应该了解Web应用程序的所有生命周期都在HTTP请求和HTTP响应之间。即使您的应用程序立即创建响应,无论您如何优化,大型页面的传输时间都是不可接受的。交通是交通,你无法绕过它。



但是更重要的原因是用户不想一次看到你的所有数据,即使一切都可能暂时发生(但它不会)。用户将有问题一次导航和消化太多数据。几百行(我故意不说记录,因为你可以应用不同的记录呈现方式;记录可以是非常不同的大小)会很好,但几乎没有。这没有任何意义。



总的来说,情况并非那么糟糕。您需要彻底考虑以较小的块呈现数据的方式。这比编写代码更具设计性。您可以考虑分页,查询,分页和某些方法组合等方法。



-SA
One simple principle is that you never want to show really huge amount of data on a single page.

Moreover, your user also won''t want it. You should understand that all the lifetime of a Web application lies between HTTP request and HTTP response. Even if your application creates a response in no time, the transport time along will be unacceptable for a big page, no matter how you optimize it. Traffic is traffic, you cannot get around it.

But there is more important reason why the user don''t want to see all your data at once, even if everything could happen momentarily (but it won''t). The user will have problem to navigate and digest too much data at once. Few hundreds lines (I intentionally don''t say "records", because you can apply different way of presentation of records; and the records can be of very different sizes) would be fine, but hardly thousands. It just makes no sense.

So, overall, the picture is not that bad. You need to thoroughly think of a way of presenting data in smaller chunks. This is more design than writing code. You can think of such approaches as paging, queries, paging, and some combinations of approaches.

—SA


也许你应该为那个大型DataList禁用ViewState,或者你应该以某种方式对你的页面进行一些过滤,这样你就不需要加载那么多数据,或者考虑实现一些无限滚动功能无休止的滚动或者只做两者(过滤和其中一个花哨的滚动功能)。



希望它有所帮助。
Maybe you should disable ViewState for that large DataList or you should just somehow get some filtering to your page so that you don''t need to load that much data, or consider implementing some infinite scrolling feature or endless scrolling or just do both(filtering and one of the fancy scrolling features).

Hope that it helps.


这篇关于Webform,加载,显示和处理大量数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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