| |
8. 2. 9. To specify the data types: Currency, Date, Double, Integer, String |
|
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Button1_Click(sender As Object, e As EventArgs)
Label1.Text = "Passwords match"
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>CompareFieldValidator</title>
</head>
<body>
<form id="Form1" runat="server">
Age:
<asp:TextBox ID="TextBox1" Runat="server" MaxLength="3"/>
<asp:CompareValidator ID="CompareValidator1"
Runat="server"
ErrorMessage="You must enter a number"
ControlToValidate="TextBox1"
Type="Integer"
Operator="DataTypeCheck"/>
<asp:Button ID="Button1" OnClick="Button1_Click"
Runat="server" Text="Login"></asp:Button>
<asp:Label ID="Label1" Runat="server"></asp:Label>
</form>
</body>
</html>
|
|
|