[Mono-bugs] [Bug 52770][Nor] New - input element does not need a runat=server attribute

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 12 Jan 2004 06:02:10 -0500 (EST)


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 mwh@sysrq.dk.

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

--- shadow/52770	2004-01-12 06:02:10.000000000 -0500
+++ shadow/52770.tmp.21764	2004-01-12 06:02:10.000000000 -0500
@@ -0,0 +1,104 @@
+Bug#: 52770
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: Mono-0.29, xsp-0.8
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mwh@sysrq.dk               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: input element does not need a runat=server attribute
+
+Troughout Mono ASP.NET the <input type=submit /> needs a runat=server
+attribute to function. In .NET that is not nessesary, the <input
+type=submit /> is only needed to generate a post back.
+
+Example.
+
+<!-- A sample form validation -->
+<%@ Page Language=C# AutoEventWireup=false %>
+                                                                          
+                       
+<html>
+<body>
+                                                                          
+                       
+<form runat=server>
+<table>
+ <tr>
+  <td>
+   <table>
+    <tr>
+     <td></td>
+     <td span=2><b><u>Account Information</u>:</b></td>
+     <td></td>
+    </tr>
+    <tr>
+     <td>First name:</td>
+     <td><asp:TextBox id="FirstName" runat=server /></td>
+     <td><asp:RequiredFieldValidator id="FirstNameValidator"
+          ControlToValidate="FirstName" Display=Static
+          InitialValue="" runat=server
+          ErrorMessage="The first name field must be completed.">*
+         </asp:RequiredFieldValidator>
+     </td>
+    </tr>
+    <tr>
+     <td>Last name:</td>
+     <td><asp:TextBox id="LastName" runat=server /></td>
+     <td><asp:RequiredFieldValidator id="LastNameValidator" runat=server
+          ControlToValidate="LastName" Display=Static InitialValue=""
+          ErrorMessage="The last name field must be completed.">*
+         </asp:RequiredFieldValidator>
+     </td>
+    </tr>
+    <tr>
+     <td>E-mail:</td>
+     <td><asp:TextBox id="Email" runat=server /></td>
+     <td><asp:RequiredFieldValidator id="EmailValidator" runat=server
+          ControlToValidate="Email" Display=Static InitialValue=""
+          ErrorMessage="The email field must be completed.">*
+         </asp:RequiredFieldValidator>
+         <asp:RegularExpressionValidator id="RegularValidator" runat=server
+          ControlToValidate="Email" Display=Static InitialValue=""
+          ErrorMessage="E-mail must be of the form foo@bar.baz"
+          ValidationExpression="\w+@\w+\.\w+">*
+         </asp:RegularExpressionValidator>
+     </td>
+    </tr>
+    <tr>
+     <td></td>
+
+<!-- In Mono the runat=server is required -->
+     <td><input value="Submit" type=submit runat=server /></td>
+
+<!-- In .NET it is not
+     <td><input value="Submit" type=submit /></td>
+-->
+    </tr>
+   </table>
+  </td>
+  <td>
+   <table>
+    <tr>
+     <td><asp:ValidationSummary id="ValSum" runat=server
+          HeaderText="Please correct the following errors:"
+          ShowMessageBox="True" ShowSummary="True" />
+     </td>
+    </tr>
+   </table>
+  </td>
+ </tr>
+</table>
+</form>
+                                                                          
+                       
+</body>
+</html>