Gridview databind takes 20 seconds to load 140 records in ASP.Net

[亡魂溺海] 提交于 2019-12-11 11:46:56

问题


I am having issues in displaying the gridview in ASP.Net application. This loads slowly and almost takes 20 seconds to load 140 records. This becomes really slow when using IE browser.

I have a modal popup extender in one of the columns and it looks like it is loading that control every time the grid refreshes and for all rows.

Right now I am doing paging alongwith an option to view all records. Users here wanted to view all records most of the time. So I need to improve the speed of loading the gridview. Please let me know if there is any other way of using modal popup window other than extender from AJAX.

I am using modal popup window to allow the user to enter some comments related to that particular row.

Thanks in advance Anil


回答1:


You must find a way to use only one ModalPopupExtender, not one for each row. Id does render all the controls in the modalpopup'content for each row, it's normal that you page loading is slow!

One way of doing this is to put an update panel inside the ModalPopup, initialize it's contents in the RowCommand event of the gridview (you could store the row/database id in a session variable or HiddenField at this point) and show the pop-up from code behind (You may need to use a invisible target button)



来源:https://stackoverflow.com/questions/7164267/gridview-databind-takes-20-seconds-to-load-140-records-in-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!