[Mono-dev] [PATCH] System.Web.UI.WebControls.ListControl

Elliott Draper el at eldiablo.co.uk
Tue Jan 24 11:30:21 EST 2006


Hi guys,

Attached is a patch for everyone's perusal, that fixes a bug in the System.Web.UI.WebControls.ListControl class under the NET-2.0 profile, that specifically shows itself when using a DropDownList or a ListBox control. It appears that modifying the items collection on these controls during a postback (adding/removing items on the fly etc in an event handler) causes a problem during the next loading of the control state.

It's a bit tricky to write a decent test case for a bug in the web side of things, but you can see the problem (at least until I upgrade the Mono classlib on my server to include this fix) at a couple of test pages I knocked up, one for each control - http://apps.eldiablo.co.uk/TestWebApp/dropdownlisttest.aspx, and http://apps.eldiablo.co.uk/TestWebApp/listboxtest.aspx. Attempting to use the buttons on these pages to move items from one dropdown or listbox to another will result in an ArgumentOutOfRangeException.

Also attached is these two pages (and codebehind) in an archive for anyone who wants to try the patch, and try the test pages themselves, to ensure the fix works correctly. I've tried the fix against a freshly updated working copy from svn on another development box I've got here, and with these same test pages, the issue goes away.

It's a fairly small fix, so I don't imagine any problems, but any comments, let me know :-)

Cheers,
Elliott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20060124-System.Web.UI.WebControls.ListControl.patch
Type: application/octet-stream
Size: 615 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060124/cf3522f9/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20060124-ListControlTestPages.tar.gz
Type: application/gzip
Size: 1717 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060124/cf3522f9/attachment.bin 


More information about the Mono-devel-list mailing list