ASP.NET(vb.net) & RequirdFieldValidator - asp:RequirdFieldValidator : Makes the associated input control a required field.
ShotDev Focus:
- ASP.NET(vb.net) & RequirdFieldValidator
Tag Control
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
Example
RequiredFieldValidator.aspx
<%@ Page Language="VB" %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <form id="form1" runat="server"> Name<br /> <asp:TextBox id="txtName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator id="myReqValid1" runat="server" ErrorMessage="Please input [Name]" ControlToValidate="txtName"></asp:RequiredFieldValidator><br /> Email<br /> <asp:TextBox id="txtEmail" runat="server"></asp:TextBox> <asp:RequiredFieldValidator id="myReqValid2" runat="server" ErrorMessage="Please Input [Email]" ControlToValidate="txtEmail"></asp:RequiredFieldValidator><br /> <asp:Button id="btnSubmit" runat="server" Text="Submit" /> </form> </body> </html>
Screenshot