You must Sign In to post a response.
  • Category: .NET

    What attribute must be set on a validator control for the validation to work ? Validate

    What attribute must be set on a validator control for the validation to work ?
    Validate
    ValidateControl
    ControlToBind
    ControlToValidate
  • #586038
    ControltoValidate property has to be set for the validator control should work in asp.net.

    The validator control can be used for any types of validation like empty check or we can map any reqular expressions


    <asp:requiredfieldvalidator id="TextBoxRequiredValidator"
    controltovalidate="NumberTextBox"
    enableclientscript="False"
    display="Dynamic"
    errormessage="Please enter a value."
    text="*"
    runat="server"/>


    Thanks
    Prem

  • #586044
    Hi,

    ControlToValidate property is set on a validator control for the validation to work. It specify the input control to validate.

    Regards,
    Minu

  • #586049
    ControlToValidate is a required property for all the validation controls. If ControlToValidate is not set then the following exception will be generated:

    The ControlToValidate property of '<ValidationControl>' cannot be blank.


    Thanks & Regards
    Paritosh Mohapatra
    Microsoft MVP (ASP.Net/IIS)
    DotNetSpider MVM

  • #586064
    hi..

    ControlToValidate property is set in validate control.

    <asp:requiredfieldvalidator id="RequiredValidator1" controltovalidate="txtemail" enableclientscript="False" display="Dynamic" errormessage="Please enter Your email id." runat="server"/>

    Regards,
    Divyashree.k
    Experience is the name every one gives to their mistakes.

  • #586074
    *ControlToValidate is the mandatory property that must be set for Validation controls.

    Ex:
    <asp:RequiredFieldValidator id="rfvName" runat="server" ControlToValidate = "txtName" ErrorMessage = "Please enter name"></asp:RequiredFieldValidator>

  • #586082
    hi ControlToValidate is mandatory property for any validation control


    hope this will help you

  • #586118
    hi

    you must have to set

    controlToValidate property of validation control

    regards

    vipul dumaniya


This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.