ASP.NET HTML 控件 CustomValidator
asp.net html 控件 customvalidator
<script runat="server">
sub user(source as object,args as servervalidateeventargs)
if len(args.value)<8 or len(args.value)>16 then
args.isvalid=false
else
args.isvalid=true
end if
end sub
</script>
<!doctype html>
<html>
<body>
<form runat="server">
<asp:label runat="server" text="enter a username: " />
<asp:textbox id="txt1" runat="server" />
<asp:button text="submit" runat="server"/>
<br>
<asp:label id="mess" runat="server"/>
<br>
<asp:customvalidator
controltovalidate="txt1"
onservervalidate="user"
text="a username must be between 8 and 16 characters!"
runat="server"/>
</form>
</body>
</html>
sub user(source as object,args as servervalidateeventargs)
if len(args.value)<8 or len(args.value)>16 then
args.isvalid=false
else
args.isvalid=true
end if
end sub
</script>
<!doctype html>
<html>
<body>
<form runat="server">
<asp:label runat="server" text="enter a username: " />
<asp:textbox id="txt1" runat="server" />
<asp:button text="submit" runat="server"/>
<br>
<asp:label id="mess" runat="server"/>
<br>
<asp:customvalidator
controltovalidate="txt1"
onservervalidate="user"
text="a username must be between 8 and 16 characters!"
runat="server"/>
</form>
</body>
</html>
相关文章
- ASP.NET Web Pages 文件夹
- ASP.NET Web Pages 文件
- ASP.NET Web Pages 类参考手册
- ASP.NET Web Pages WebMail 参考手册
- ASP.NET Razor VB 变量
- ASP.NET MVC 简介
- ASP.NET MVC 文件夹
- ASP.NET MVC 控制器
- ASP.NET 事件句柄
- ASP.NET 实例
- ASP.NET ImageButton 控件
- ASP.NET BulletedList 控件
- ASP.NET Table 控件
- ASP.NET XML 控件
- WebSecurity GeneratePasswordResetToken 方法
- WebSecurity GetCreateDate 方法
- WebSecurity IsConfirmed 方法
- HTML InputCheckbox
- ASP.NET HTML 控件 CheckboxList
- ASP.NET HTML 控件 DataList