* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.Web / Test / standalone / validators / compare2.aspx
1 <%@ Page Language="C#" AutoEventWireup="True" %>
2  
3 <html>
4 <head>
5    <script runat="server">
6  
7       void Button_Click(Object sender, EventArgs e) 
8       {
9  
10          if (Page.IsValid) 
11          {
12             lblOutput.Text = "Result: Valid!";
13          }
14          else 
15          {
16             lblOutput.Text = "Result: Not valid!";
17          }
18
19       }
20  
21       void Operator_Index_Changed(Object sender, EventArgs e) 
22       {
23
24          Compare1.Operator = (ValidationCompareOperator) ListOperator.SelectedIndex;
25          Compare1.Validate();
26
27       }
28
29       void Type_Index_Changed(Object sender, EventArgs e) 
30       {
31
32          Compare1.Type = (ValidationDataType) ListType.SelectedIndex;
33          Compare1.Validate();
34
35       }
36  
37    </script>
38  
39 </head>
40 <body>
41  
42    <form runat=server>
43
44       <h3>CompareValidator Example</h3>
45       <p>
46       Enter a value in each textbox. Select a comparison operator<br>
47       and data type. Click "Validate" to compare values.
48  
49       <table bgcolor="#eeeeee" cellpadding=10>
50
51          <tr valign="top">
52
53             <td>
54
55                <h5>String 1:</h5>
56                <asp:TextBox id="TextBox1" 
57                     runat="server"/>
58
59             </td>
60
61             <td>
62
63                <h5>Comparison Operator:</h5>
64  
65                <asp:ListBox id="ListOperator" 
66                     OnSelectedIndexChanged="Operator_Index_Changed" 
67                     runat="server">
68
69                   <asp:ListItem Selected Value="Equal">Equal</asp:ListItem>
70                   <asp:ListItem Value="NotEqual">NotEqual</asp:ListItem>
71                   <asp:ListItem Value="GreaterThan">GreaterThan</asp:ListItem>
72                   <asp:ListItem Value="GreaterThanEqual">GreaterThanEqual</asp:ListItem>
73                   <asp:ListItem Value="LessThan">LessThan</asp:ListItem>
74                   <asp:ListItem Value="LessThanEqual">LessThanEqual</asp:ListItem>
75                   <asp:ListItem Value="DataTypeCheck">DataTypeCheck</asp:ListItem>
76
77                </asp:ListBox>
78
79             </td>
80
81             <td>
82
83                <h5>String 2:</h5>
84                <asp:TextBox id="TextBox2" 
85                     runat="server"/>
86                <p>
87                <asp:Button id="Button1"
88                     Text="Validate"  
89                     OnClick="Button_Click" 
90                     runat="server"/>
91
92             </td>
93          </tr>
94
95          <tr>
96             <td colspan="3" align="center">
97
98                <h5>Data Type:</h5>
99
100                <asp:ListBox id="ListType" 
101                     OnSelectedIndexChanged="Type_Index_Changed" 
102                     runat="server">
103
104                   <asp:ListItem Selected Value="String" >String</asp:ListItem>
105                   <asp:ListItem Value="Integer" >Integer</asp:ListItem>
106                   <asp:ListItem Value="Double" >Double</asp:ListItem>
107                   <asp:ListItem Value="Date" >Date</asp:ListItem>
108                   <asp:ListItem Value="Currency" >Currency</asp:ListItem>
109
110                </asp:ListBox>
111             </td>
112          </tr>
113       </table>
114  
115       <asp:CompareValidator id="Compare1" 
116            ControlToValidate="TextBox1" 
117            ControlToCompare="TextBox2"
118            EnableClientScript="False" 
119            Type="String" 
120            runat="server"/>
121  
122       <br>
123        
124       <asp:Label id="lblOutput" 
125            Font-Name="verdana" 
126            Font-Size="10pt" 
127            runat="server"/>
128  
129    </form>
130  
131 </body>
132 </html>