ASP.NET(vb.net) & CustomValidator - asp:CustomValidator : Performs user-defined validation on an input control. … Name Description; AccessKey: Gets or sets the access key that allows you to quickly navigate to the Web server control.
ShotDev Focus:
- ASP.NET(vb.net) & CustomValidator
Tag Control
<asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="CustomValidator"></asp:CustomValidator>
Example
CustomValidator.aspx
<%@ Page Language="VB" %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <script language="JavaScript"> function CheckForm() { alert(document.getElementById("txtName").value); return false; } </script> <body> <form id="form1" runat="server"> Input Name<br /> <asp:TextBox id="txtName" runat="server"></asp:TextBox> <asp:CustomValidator id="myCustomValidator" runat="server" ClientValidationFunction="CheckForm" ControlToValidate="txtName"></asp:CustomValidator><br /> <asp:Button id="btnSubmit" runat="server" Text="Submit" /> </form> </body> </html>
Screenshot