[Mono-devel-list] [PATCH] (With test cases) asp.net's ListControl.cs fixes.

Yaacov Akiba Slama ya at slamail.org
Thu Aug 14 06:23:39 EDT 2003


Hello,

Below is a patch fixing some bugs in
mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs

[ The work was done by Yaron Shkop <yaronsh at mainsoft.com> ]

1) "DataSource" property (set). A null value is legal.

The enclosed test1.asx is a small test case with two buttons Clear and 
Fill. Clear puts null in Datasource. That's work in MS's asp.net but not 
in mono without this patch.

2) Add a "CachedSelectedValue" private variable and its use in property
"SelectedValue" and in "the OnDataBinding" method. Its purpose is to
give the control a selected value before binding it to data (the same
mechanism is already here for "CachedSelectedindex").

The enclosed test2.aspx set "SelectedValue" before defining and binding 
the datasource and it choose the right value in the datasource as soon 
the binding is done in MS asp.net.

3) Fix in "OnDataBinding" the case when exactly one of DataTextField and
DataValueField has a lenght > 0.

test3.aspx uses only datavaluefield and works in MS's asp.net but not in 
mono witjout this patch.

The patch seems to work here and IMHO can be applied to your tree.

Thanks,
Yaacov Akiba Slama


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ListControl.cs.diff
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030814/747857c7/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test1.aspx
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030814/747857c7/attachment-0001.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test2.aspx
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030814/747857c7/attachment-0002.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test3.aspx
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030814/747857c7/attachment-0003.pl 


More information about the Mono-devel-list mailing list