[英]How to speed up Dropdownlist SelectedIndexChanged event
I am binding a gridview on a Dropdownlist_SelectedIndexChanged event, but I find this process to be too slow. 我在Dropdownlist_SelectedIndexChanged事件上绑定了一个网格视图,但是我发现这个过程太慢了。 It is taking 50-60 seconds to populate, while the amount of data i'm displaying is not bulky.
填充需要50-60秒,而我显示的数据量却不大。 (max 40 rows).
(最多40行)。 How to speed up selectedindexchanged performance?
如何加快所选索引的性能?
Are you binding the grid view every time depend upon selectedIndex?if it is the case, may be because of sql transaction page is slow, 您是否每次都依赖于selectedIndex绑定网格视图?如果是这种情况,可能是由于sql事务页面运行缓慢,
you can save your data-table
in session or view state
and filter this data-table based upon the selected index. 您可以将
data-table
保存为session or view state
并根据所选索引过滤该数据表。 this will stop the hit to sql server. 这将停止对sql server的攻击。
on other way you can use ajax to get data-table ,this will prevent your full page post back. 在另一种方式上,您可以使用ajax获取数据表,这将阻止您的整页发回。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.