且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MVC中foreach循环内的HTML表格执行速度太慢

更新时间:2023-02-06 13:46:00

创建这么大的表总是很慢。没有人可以处理那么多的信息,因此解决方案是通过使用paging\filtering\sorting等来减少你显示的内容,只显示相关的数据位。
Creating such a large table is always going to be slow. No human being can possibly process that amount of information so the solution is to reduce what you display by using paging\filtering\sorting etc to show only relevant bits of data.


渲染有这么大记录的表总是需要时间。我建议你改用网格。或者为您的表提供分页功能 - 不会一次显示所有数据。



参考这篇文章关于在MVC中使用基本网格 -

在ASP.NET MVC中使用Grid.MVC [ ^ ]

有替代品对于这个网格,你可以谷歌吧:)





-KR
Rendering the table with such large records always going to take time. I'd suggest you to use the Grid instead. Or provide the paging feature for your table - that won't display all the data in one shot.

Refer this article about using the basic grid in MVC-
Using the Grid.MVC in ASP.NET MVC[^]
There are alternatives too for this grid, you can google it out :)


-KR