Tests
[mono.git] / mcs / class / System.Web / Test / standalone / validators / validationgroup.aspx
1 <%@ Page Language="C#" AutoEventWireup="True" %>
2
3 <html>
4
5 <head>
6
7    <script runat="server">
8       void ButtonClick(Object sender, EventArgs e)
9       {
10
11          if (Page.IsValid)
12          {
13             Label.Text="Area is valid.";
14          }
15          else
16          {
17             Label.Text="Area is not valid!!";
18          }
19       }
20    </script>
21
22 </head>
23
24 <body>
25
26    <form runat="server">
27
28       <h3>Area 1</h3>
29
30       Enter a number from 1 to 10:
31
32       <br>
33
34       <asp:TextBox id="TextBox1"
35            runat="server"/>
36
37       <br>
38
39       <asp:RangeValidator id="Range1"
40            ValidationGroup="Area1"
41            ControlToValidate="TextBox1"
42            MinimumValue="1"
43            MaximumValue="10"
44            Type="Integer"
45            EnableClientScript="false"
46            Text="The value must be from 1 to 10!"
47            runat="server"/>
48
49       <br><br>
50
51       <asp:Label id="Label1"
52            runat="server"/>
53
54       <br><br>
55
56       <asp:Button id="Button1"
57            ValidationGroup="Area1"
58            Text="Submit"
59            OnClick="ButtonClick"
60            runat="server"/>
61             
62
63         <h3>Area 2</h3>
64
65       Enter a number from 1 to 10:
66
67       <br>
68
69       <asp:TextBox id="TextBox1"
70            runat="server"/>
71
72       <br>
73
74       <asp:RangeValidator id="Range1"
75            ValidationGroup="Area2"
76            ControlToValidate="TextBox1"
77            MinimumValue="1"
78            MaximumValue="10"
79            Type="Integer"
80            EnableClientScript="false"
81            Text="The value must be from 1 to 10!"
82            runat="server"/>
83
84       <br><br>
85
86       <asp:Label id="Label1"
87            runat="server"/>
88
89       <br><br>
90
91       <asp:Button id="Button1"
92            ValidationGroup="Area2"
93            Text="Submit"
94            OnClick="ButtonClick"
95            runat="server"/>
96
97    </form>
98
99 </body>
100 </html>