ASP.NET HTML 控件 RangeValidator 2

asp.net html 控件 rangevalidator 2

<script  runat="server">
sub submit(sender as object, e as eventargs)
if page.isvalid then
   lbl1.text="page is valid."
else
   lbl1.text="page is not valid!!"
end if
end sub
</script>


<!doctype html>
<html>
<body>

<form runat="server">
enter a number from 1 to 100:
<asp:textbox id="tbox1" runat="server" />
<br><br>
<asp:button text="submit" 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="the value must be from 1 to 100!"
runat="server" />
</form>

</body>
</html>
相关文章