Monday, March 26, 2012

listbox in updatepannel takes to long

Hello, I have an updatePanel and inside of it i have textbox, listbox and div. And it all works perfecly if in the listbox i have to 100 rows. But in few cases i have arround 6000 rows. The problem occures when i select a row from the lisbox with 6000 rows and I'm tryning to put some message into the Div. It assignes the InnerHtml of the div and waits for about 1 minute with 100% processor activity and then it displays the div content. How can i shorten this time? Any sugestions?

Thanks

The UpdatePanel passes the ViewState for the whole page each time you do this, not to mention it sounds like 6000 records are being rebound. Remember the whole UpdatePanel needs to update... A better approach would to be use something like PageMethods to get the message (seehttp://encosia.com/index.php/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous) and then fill the DIV client-side.

-Damien


See the following thread and side threads for a long discussion of the problem and code that will cut the update time to milliseconds if your listbox is simple.

http://forums.asp.net/p/1065352/1540804.aspx

There are other ways of doing it as Damien suggested, but most of them involve the PageRequestManager (http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys.WebForms/PageRequestManagerClass/default.aspx) as the best solution.


http://forums.asp.net/t/1065004.aspx


Actualy I solved it with this link:

http://encosia.com/index.php/2007/07/13/easily-refresh-an-updatepanel-using-javascript/

No comments:

Post a Comment