Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Bug in WebForm_InitCallback w/ Multi-Select ListBoxes (first reported in 2006!)

$
0
0

Hi,

When use Callbacks with Multi-Select ListBoxes, there is an error with WebForm_InitCallback.  It was reported in this thread:

http://forums.asp.net/t/1056775.aspx?Problem+With+Using+Multi+Select+Listboxes+and+Callbacks

and is still active in ASP.NET Ajax.

The problem is this line:

else if (tagName == "select") {
            var selectCount = element.options.length;
            for (var j = 0; j < selectCount; j++) {
                var selectChild = element.options[j];
                if (selectChild.selected == true) {
                    WebForm_InitCallbackAddField(element.name, element.value);

And the fix is to use selectChild.value instead of element.value.  It ends up repeating the first selected value N times instead of having all the selected values.

I will report the bug on connect.microsoft.com.  I am not surprised it was not noticed; multi-select listboxes are not often used.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>