ASP.NET HTML 控件 RegularExpressionValidator
asp.net html 控件 regularexpressionvalidator
<script runat="server">
sub submit(sender as object, e as eventargs)
if page.isvalid then
lbl.text="the page is valid!"
else
lbl.text="the page is not valid!"
end if
end sub
</script>
<!doctype html>
<html>
<body>
<form runat="server">
enter a us zip code:
<asp:textbox id="txtbox1" runat="server" />
<br><br>
<asp:button text="submit" onclick="submit" runat="server" />
<br><br>
<asp:label id="lbl" runat="server" />
<br>
<asp:regularexpressionvalidator
controltovalidate="txtbox1"
validationexpression="\d{5}"
enableclientscript="false"
errormessage="the zip code must be 5 numeric digits!"
runat="server" />
</form>
</body>
</html>
sub submit(sender as object, e as eventargs)
if page.isvalid then
lbl.text="the page is valid!"
else
lbl.text="the page is not valid!"
end if
end sub
</script>
<!doctype html>
<html>
<body>
<form runat="server">
enter a us zip code:
<asp:textbox id="txtbox1" runat="server" />
<br><br>
<asp:button text="submit" onclick="submit" runat="server" />
<br><br>
<asp:label id="lbl" runat="server" />
<br>
<asp:regularexpressionvalidator
controltovalidate="txtbox1"
validationexpression="\d{5}"
enableclientscript="false"
errormessage="the zip code must be 5 numeric digits!"
runat="server" />
</form>
</body>
</html>
相关文章
- ASP.NET Web Pages 教程
- ASP.NET Web Pages 文件夹
- ASP.NET Web Pages WebSecurity 参考手册
- ASP.NET MVC 模型
- ASP.NET MVC – 发布
- ASP.NET Web 页面
- ASP.NET ViewState
- ASP.NET SortedList
- ASP.NET XML 数据绑定
- ASP.NET RegularExpressionValidator 控件
- ASP.NET RequiredFieldValidator 控件
- ASP.NET PlaceHolder 控件
- WebSecurity ChangePassword 方法
- WebSecurity GetPasswordChangeDate 方法
- WebSecurity UserExists 方法
- HTML Image 2
- ASP.NET HTML 控件 Literal
- ASP.NET HTML 控件 用 重复
- ASP.NET HTML 控件 Table
- ASP.NET HTML 控件Table 2