<script runat="server">
Sub submit(sender As Object, e As EventArgs)
If Page.IsValid Then
lbl1.Text=""
Else
lbl1.Text=""
End If
End Sub
</script>
<html>
<body>
<form runat="server">
请输入 1 到 100 :
<asp:TextBox id="tbox1" runat="server" />
<br /><br />
<asp:Button Text="提交" OnClick="submit" runat="server" />
<br /><br />
<asp:Label id="lbl1" runat="server" />
<br />
<asp:RangeValidator
ControlToValidate="tbox1"
MinimumValue="1"
MaximumValue="100"
Type="Integer"
EnableClientScript="false"
Text=" 1 到 100 之间。"
runat="server" />
</form>
</body>
</html>