[Mono-bugs] [Bug 79445][Nor] New - ListBox Selectedindex problem when enabled=false

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Sep 19 12:47:17 EDT 2006


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 informatique.internet at fiducial.fr.

http://bugzilla.ximian.com/show_bug.cgi?id=79445

--- shadow/79445	2006-09-19 12:47:17.000000000 -0400
+++ shadow/79445.tmp.8961	2006-09-19 12:47:17.000000000 -0400
@@ -0,0 +1,83 @@
+Bug#: 79445
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Web
+AssignedTo: gonzalo at ximian.com                            
+ReportedBy: informatique.internet at fiducial.fr               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ListBox Selectedindex problem when enabled=false
+
+Description of Problem:
+When a ListBox control is disabled (enabled=false), the selected index is
+always=-1 after a postback
+
+Steps to reproduce the problem:
+1. try this aspx
+<%@ Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
+Transitional//EN">
+<script runat="server">
+protected void Ecrit(object sender, EventArgs e)
+{
+	if (!IsPostBack)
+	{
+		listbox1.Items.Clear();
+		listbox1.Items.Add("essai1");
+		listbox1.Items.Add("essai2");
+		listbox1.Items.Add("essai3");
+		
+		listbox1.Enabled=false;
+		listbox1.SelectedIndex=1;
+		
+		drplist1.Items.Clear();
+		drplist1.Items.Add("essai1");
+		drplist1.Items.Add("essai2");
+		drplist1.Items.Add("essai3");
+		drplist1.Enabled=false;
+		drplist1.SelectedIndex=2;
+	}
+}
+protected void clickboutton(object sender, EventArgs e)
+{
+	label1.Text="Selected "+listbox1.SelectedIndex+" "+drplist1.SelectedIndex;
+}
+ 
+</script>
+<html><head>
+  <title>Default</title>
+</head><body>
+<form id="form1" runat="server" OnLoad="Ecrit">
+<asp:ListBox id="listbox1" Runat="server"></asp:ListBox>
+<asp:DropDownList id="drplist1" Runat="server" ></asp:DropDownList>
+<asp:Button ID="boutton1" Runat="server" Text="Click me"
+OnClick="clickboutton"></asp:Button>
+<br/>
+<asp:Label id="label1" Runat="server"></asp:Label>
+	</form>
+</body></html>
+
+2.Click on the button
+
+Actual Results:
+Selected -1 2
+
+Expected Results:
+On MS.NET we have
+Selected 1 2
+
+How often does this happen? 
+always
+
+Additional Information:
+The dropdown works while the listbox control doesn't.
+
+
+Thanks


More information about the mono-bugs mailing list