<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>