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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=82192 --- 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: +OS Details: FC6 +Status: NEW +Resolution: +Severity: +Priority: Normal +Component: Sys.Web +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +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")); +} +</script> +<html> +<body> +<form runat='server'> + <asp:DropDownList id='quantity' runat='server'> + <asp:ListItem text="123" /> + </asp:DropDownList> + <asp:Button text="Postback" runat="server" /> +</form> +</body> +</html> + +Request the page, click the button (once or twice). +Result: + +System.ArgumentOutOfRangeException: Index is less than 0 or more than or +equal to the list count. +Parameter name: index +0 + at System.Collections.ArrayList.get_Item (Int32 index) [0x00000] + at System.Web.UI.WebControls.ListItemCollection.get_Item (Int32 index) +[0x00000] + 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) +[0x00000] + +Reverting to a revision prior to r81396 fixes the problem (e.g. +"svn up -r {2007-07-04} +mcs/class/System.Web/System.Web.UI.WebControls/List*.cs"). _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
