Wednesday, March 28, 2012

AJAX Bug?

I have a page with an upper UpdatePanel that has 3 collapsible panel's and a lower UpdatePanel that has 2 gridviews in it. What happens is you select a list of employees and different training items in the upper UpdatePanel and a cross-tab grid is displayed in the lower UpdatePanel. Once the data is loaded into the cross-tab, it goes through every cell to update the text data to a graphical view of the data. So instead of 0 you would see a blank checkbox, and instead of 2 you would see a checked checkbox. The gridview columns are created dynamically based on what training selections were made. There can be as many as 400 training items at once and a couple hundred employees as well, so you can imagine how big the cross-tab grid can become if everything is selected. This page worked GREAT before I implemented ajax on it(I have my reasons), but now with AJAX in the page the cross-tab will only show if only a small number of employees or trainig items are selected. If you try to select every training item and every employee the whole program crashes in a very nasty way. Imagine losing the whole IE menu bars and start button, quickstart buttons, etc. The WHOLE screen becomes a jumbled mess. Any suggestions? Is this a bug or am I just trying to access too much data through AJAX?

JavaScript just flat out sucks with large amounts of data when looping.

You are probably causing JavaScript to have to loop through 1000's of form elements to figure out what is selected and build a string of that data to be posted. The freezing is the browser eating your CPU trying to crunch all of that data.

Eric


Thanks for the reply. I am starting to understand that this is the reason. Can you think of any workarounds? The only reason AJAX is being used on the page is to get the browser back button to work correctly so that the user can't click back and have someone's employee trained status revert to the previous state. Is there another way around this? Thanks.
hi.
i'm not sure if you're using updatepanels or are you wroking directly with javascript?
Here is a good post on JavaScript performance recommendations:http://blogs.msdn.com/ie/archive/2006/08/28/728654.aspx
Using Ajax
using Ajax.net with Update Panels.

No comments:

Post a Comment