[Mono-bugs] [Bug 61831][Wis] New - RequiredFieldValidator still affect page validation when it's disabled

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 22 Jul 2004 11:11:24 -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 jackchen@tcn.net.

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

--- shadow/61831	2004-07-22 11:11:24.000000000 -0400
+++ shadow/61831.tmp.5646	2004-07-22 11:11:24.000000000 -0400
@@ -0,0 +1,77 @@
+Bug#: 61831
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jackchen@tcn.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: RequiredFieldValidator still affect page validation when it's disabled
+
+Description of Problem:
+When a RequiredFieldValidator is disabled, it still make 
+the page inWalid.
+
+
+Steps to reproduce the problem:
+1. 
+
+create a webform with following code:
+
+test_validator.aspx:
+
+<form id="test_validator" method="post" runat="server">
+    <asp:TextBox id="edtInput1" style="Z-INDEX: 101; LEFT: 230px; 
+POSITION: absolute; TOP: 120px" runat="server"></asp:TextBox>
+    <asp:RequiredFieldValidator id="RequiredFieldValidator1" style="Z-
+INDEX: 102; LEFT: 414px; POSITION: absolute; TOP: 119px" runat="server" 
+ErrorMessage="RequiredFieldValidator" Width="238px" 
+ControlToValidate="edtInput1"></asp:RequiredFieldValidator>
+    <asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 287px; POSITION: 
+absolute; TOP: 178px" runat="server" Width="129px" 
+Text="Check"></asp:Button>
+    <asp:Label id="lbResult" style="Z-INDEX: 104; LEFT: 196px; POSITION: 
+absolute; TOP: 43px" runat="server" Width="371px">Please click the Check 
+Button</asp:Label>
+</form>
+ 
+test_validator.aspx.cs:
+                private void Button1_Click(object sender, System.EventArgs 
+e)
+                {
+                        this.RequiredFieldValidator1.Enabled=false;
+                        Page.Validate();
+                        if ( Page.IsValid )
+                                this.lbResult.Text="This Page is valid.";
+                        else
+                                this.lbResult.Text="This Page is not 
+valid.";
+                }
+ 
+2. 
+
+click the "Check" button.
+
+
+Actual Results:
+if you didn't input any charactor in the textbox, it show:
+"The Page is not valid", otherwise it show "The Page is valid".
+
+Expected Results:
+It should always show "The Page is valid" since the 
+RequiredFieldValidator1 was disabled.
+
+
+How often does this happen? 
+always.
+
+Additional Information:
+same code works as expect under MS.NET