[Mono-bugs] [Bug 35677][Nor] New - An example of a simple calculator (addition only) that doesn't work on mono asp.net

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
16 Dec 2002 16:47:31 -0000


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 henrik.ingo@tieturi.fi.

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

--- shadow/35677	Mon Dec 16 11:47:31 2002
+++ shadow/35677.tmp.18329	Mon Dec 16 11:47:31 2002
@@ -0,0 +1,109 @@
+Bug#: 35677
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 7.3
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: henrik.ingo@tieturi.fi               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: An example of a simple calculator (addition only) that doesn't work on mono asp.net
+
+I'm sorry that this last bug report is a bit more vague than the previous 
+ones. I still tought that it could be useful for you to have more than 
+your own examples to test on.
+
+Since this is the last bug for today, I'll take the opportunity to wish 
+you all a merry christmas and a happy new year. Remember to spend some 
+time away from mono :-)
+
+
+Description of Problem:
+This time, I got some simple code (attached below) from our .net teacher. 
+Put simply: It doesn't work. Let me explain:
+
+Steps to reproduce the problem:
+(I'll add some probably very unnecessary details just to be on the safe 
+side.)
+1. xsp still up and running...
+2. I saved this as kllaskin.aspx in a directory somewhere and symlinked it 
+to xsp-2.0/server/test/oppi/
+3. open localhost:8080/oppi/kllaskin.aspx
+
+Actual Results:
+The page loads fine, but pressing the "Laske" button doesn't do anything.
+
+Expected Results:
+Two numbers in the first two fields should be added and displayed in the 
+third field.
+
+
+More detail:
+The button is type="button". In MS .net some JavaScript is inserted to 
+make the button send the form. This doesn't happen in Mono. (I got the 
+impression that you really don't want to see MS:s code, so I want tell you 
+what it looked like :-)
+
+Changing to type="submit" makes the button work and the form is sent. On 
+the resulting page all fields are empty. (Hmm... I guess this is actually 
+a different bug. Sorry about not filing it separately.)
+
+
+
+Additional Information:
+
+original aspx:
+
+<HTML>
+	<script language="C#" runat="server">
+		private void Page_Load(object sender, System.EventArgs e)
+		{
+			// Put user code to initialize the page here
+		}
+
+		override protected void OnInit(EventArgs e)
+		{
+			this.btnLaske.ServerClick += new 
+System.EventHandler(this.btnLaske_ServerClick);
+			this.Load += new System.EventHandler
+(this.Page_Load);
+
+			base.OnInit(e);
+		}
+					
+		private void btnLaske_ServerClick(object sender, 
+System.EventArgs e)
+		{			
+			txtTulos.Value = Convert.ToString(Convert.ToInt32
+(txtLuku1.Value) + Convert.ToInt32(txtLuku2.Value));
+		}
+
+	</script>
+
+	<body>
+		<form id="Form1" method="post" runat="server">
+			<P>Luku 1</P>
+			<P>
+				<INPUT id="txtLuku1" type="text" 
+name="Text1" runat="server"></P>
+			<P>Luku2</P>
+			<P>
+				<INPUT id="txtLuku2" type="text" 
+name="Text2" runat="server"></P>
+			<P>
+				<INPUT id="btnLaske" type="button" 
+value="Laske" name="Button1" runat="server"></P>
+			<P>Tulos</P>
+			<P>
+				<INPUT id="txtTulos" type="text" 
+name="Text3" runat="server"></P>
+		</form>
+	</body>
+</HTML>