Checking Against an Initial Value with a RequiredFieldValidator Control (VB.net) : Required Field « Validation by Control « ASP.Net






Checking Against an Initial Value with a RequiredFieldValidator Control (VB.net)

<%@ Page Language=VB Debug=true %>
<HTML>
<HEAD>
<TITLE>Checking Against an Initial Value with a RequiredFieldValidator Control</TITLE>
</HEAD>
<form runat="server">
<BR><BR>
<asp:textbox 
    id="txtName" 
    text="Enter Your Name"
    runat=server 
/>
<asp:RequiredFieldValidator 
    id="rfvName1"
    controltovalidate="txtName"
    InitialValue="Enter Your Name"
    display="Dynamic"
    font-name="Verdana"
    font-size="10pt"
    forecolor="red"
    runat=server
>
You must enter your name!
</asp:RequiredFieldValidator>
<asp:requiredfieldvalidator 
    id="rfvName2"
    controltovalidate="txtName"
    display="Dynamic"
    font-name="Verdana"
    font-size="10pt"
    forecolor="red"
    runat=server
>
You must enter your name!
</asp:requiredfieldvalidator>
<BR><BR>
<asp:button 
    id="butOK"
    text="OK"
    type="Submit"
    runat="server"
/>
</form>
</BODY>
</HTML>
           
       








Related examples in the same category

1.Must enter: Required Field Validator (C#)
2.Required field validator (VB.net)
3.RequiredFieldValidator Demo: You must enter your name (VB.net)
4.Validation for aspText: cannot be empty, integer range (MaximumValue,MinimumValue) (VB.net)
5.DropDownList Must Have a Value Selected Other Than the Default