[Mono-bugs] [Bug 45493][Maj] New - bug: asp.net postback listbox

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Thu, 26 Jun 2003 12:36:02 -0400 (EDT)


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 seguso.forever@tin.it.

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

--- shadow/45493	Thu Jun 26 12:36:02 2003
+++ shadow/45493.tmp.20368	Thu Jun 26 12:36:02 2003
@@ -0,0 +1,97 @@
+Bug#: 45493
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: debian sid
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: System.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: seguso.forever@tin.it               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: bug: asp.net postback listbox
+
+Hello,  
+ 
+this seems like a bug in asp.net postback mechanism. I am not sure, but 
+gonzalo@ximian.com suggested me to file a bug. 
+ 
+I'm using mono 0.24 from debianplanet packages, and xsp from cvs. 
+ 
+To reproduce the bug: 
+ 
+1. in xsp, start the following aspx page. 
+ 
+2. Select an exam, e.g. "calculus". 
+ 
+3. Click "view subscriptions". The list of subscription correctly 
+appears.  
+ 
+4. Now click "view subscriptions" again, _without_ changing the 
+selection (i.e. leave "calculus" selected). An error message appears, 
+complaining that there was no exam selected. But it was! 
+ 
+ 
+ 
+ 
+ 
+ 
+<%@ language="C#" %> 
+ 
+<script runat="server" > 
+ 
+void Page_Load(Object Source, EventArgs E) {  
+        if (!IsPostBack){ 
+                #region fill the listbox exams 
+                exams.Items.Clear(); 
+                exams.Items.Add(new ListItem( "math")); 
+                exams.Items.Add(new ListItem( "calculus")); 
+                exams.Items.Add(new ListItem( "english"));       
+                message_subscriptions.Visible=false; 
+                subscriptions.Visible=false; 
+                #endregion 
+        } 
+        else{ 
+                if (exams.SelectedIndex >=0){    
+                         
+                        message_subscriptions.Visible=true; 
+                        subscriptions.Visible=true; 
+                        message.Text=""; 
+                        message_subscriptions.Text = "Subscriptions to 
+\"" + exams.SelectedItem.Text + "\" are:"; 
+                        subscriptions.Items.Clear(); 
+                        subscriptions.Items.Add(new ListItem( "John")); 
+                        subscriptions.Items.Add(new ListItem( "Jack")); 
+                } 
+                else{ 
+                        message.Text = "<h2>Error: no item selected. 
+SelectedIndex = " +  
+                                exams.SelectedIndex + " </h2>"; 
+                } 
+        } 
+} 
+</script> 
+ 
+<html> 
+ 
+<body> 
+<asp:label id=message runat=server ForeColor=red/> 
+<h1>Mono test page</h1> 
+Select an exam, then click "view subscriptions". 
+<form runat=server> 
+<p><asp:listbox id="exams" runat=server  /> 
+ 
+<p> <input type=submit value="View subscriptions"> 
+<p><asp:label id="message_subscriptions" runat=server /> 
+<p><asp:listbox id="subscriptions" runat=server  /> 
+ 
+</form> 
+ 
+</body> 
+ 
+</html>