Replace string concatenation in algorithm for serialization of PostBack data with array joining.


The algorithm for serialization of PostBack data implemented in the "initCallback" JavaScript function within the AjaxControl.release.js (and likewise the AjaxControl.debug.js file) uses string concatenation to generate the string the function outputs. This is not an efficient means of accomplishing this procedure. In place of the string concatenation, a string based Array will retain the output data where calls to the "push" method of the Array will append the various pieces of the data. After all data has been appended the "join" method will be called against the Array to return a single string value.
This technique is considered to be the JavaScript equivalent of using a StringBuilder object in .NET code. It will result in an increase of efficiency.
Closed May 2, 2010 at 2:42 AM by peanutbutterlou
This has been implemented. The client-side "recursiveFormElementSearch" function now makes use of pushes to a string array (StringBuilder-like technique) to build out the postback URL. This approach is more efficient than simple string concatenation.