Suggested Videos
Part 44 - RequiredField
Part 45 - Rangevalidator
Part 46 - CompareValidator
This is a very powerful validation control. This control is used to check if the value of an associated input control matches the pattern specified by a regular expression. The only property that is specific to the RegularExpressionValidator is ValidationExpression.
This example, checks if the input mataches the pattern of an email address
<asp:TextBox ID="txtEmail" runat="server" Width="150px">
</asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidatorEmail" runat="server"
ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
ErrorMessage="Invalid Email" ForeColor="Red"></asp:RegularExpressionValidator>
By default client side validation is turned on. To disable client side validation set EnableClientScript o false. This property is supported by all validation controls.
To disable validation control set Enabled propety to false.
Part 44 - RequiredField
Part 45 - Rangevalidator
Part 46 - CompareValidator
This is a very powerful validation control. This control is used to check if the value of an associated input control matches the pattern specified by a regular expression. The only property that is specific to the RegularExpressionValidator is ValidationExpression.
This example, checks if the input mataches the pattern of an email address
<asp:TextBox ID="txtEmail" runat="server" Width="150px">
</asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidatorEmail" runat="server"
ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
ErrorMessage="Invalid Email" ForeColor="Red"></asp:RegularExpressionValidator>
By default client side validation is turned on. To disable client side validation set EnableClientScript o false. This property is supported by all validation controls.
To disable validation control set Enabled propety to false.
Hi Venkat,
ReplyDeleteHow to Validate the Controls(TextBox) inside a DataBound Control such as GridView.
Please give us the idea as soon as posiible.
Regards