[Mono-bugs] [Bug 82192][Nor] New - [REGRESSION] ListControl's ViewState handling broken

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jul 26 08:57:27 EDT 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by juraj at hotfeet.ch.


--- shadow/82192	2007-07-26 08:57:27.000000000 -0400
+++ shadow/82192.tmp.11282	2007-07-26 08:57:27.000000000 -0400
@@ -0,0 +1,67 @@
+Bug#: 82192
+Product: Mono: Class Libraries
+Version: 1.2
+OS Details: FC6
+Status: NEW   
+Priority: Normal
+Component: Sys.Web
+AssignedTo: mhabersack at novell.com                            
+ReportedBy: juraj at hotfeet.ch               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: [REGRESSION] ListControl's ViewState handling broken
+Commit 81396 broken the ViewState handling of
+ListControl/ListItemCollection. An System.ArgumentOutOfRangeException is
+thrown after the (second?) postback of page containing a dynamically
+populated DropDownList:
+<%@ Page Language="C#"%>
+<script runat="server">
+void Page_Load(object o, EventArgs e) {
+	if(!IsPostBack)
+		quantity.Items.Add(new ListItem("0", "0"));
+<form runat='server'>
+	<asp:DropDownList id='quantity' runat='server'>
+		<asp:ListItem text="123" />
+	</asp:DropDownList>
+	<asp:Button text="Postback" runat="server" />
+Request the page, click the button (once or twice).
+System.ArgumentOutOfRangeException: Index is less than 0 or more than or
+equal to the list count.
+Parameter name: index
+  at System.Collections.ArrayList.get_Item (Int32 index) [0x00000] 
+  at System.Web.UI.WebControls.ListItemCollection.get_Item (Int32 index)
+  at System.Web.UI.WebControls.ListControl.LoadViewState (System.Object
+savedState) [0x00000] 
+  at System.Web.UI.Control.LoadViewStateRecursive (System.Object
+savedState) [0x00000] 
+  at System.Web.UI.Control.LoadViewStateRecursive (System.Object
+savedState) [0x00000] 
+  at System.Web.UI.Control.LoadViewStateRecursive (System.Object
+savedState) [0x00000] 
+  at System.Web.UI.Page.LoadPageViewState () [0x00000] 
+  at System.Web.UI.Page.InternalProcessRequest () [0x00000] 
+  at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context)
+Reverting to a revision prior to r81396 fixes the problem (e.g.
+"svn up -r {2007-07-04}

More information about the mono-bugs mailing list