You must Sign In to post a response.

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


Comments

#586038    Author: Kaliss    04 Feb 2011 Member Level: Gold   Points : 2

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    Author: Minu      04 Feb 2011 Member Level: Gold   Points : 2

Hi,

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


Regards,
Minu

#586049    Author: Paritosh Mohapatra    04 Feb 2011 Member Level: Gold   Points : 1

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    Author: div    04 Feb 2011 Member Level: Gold   Points : 2

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    Author: dontknow  04 Feb 2011 Member Level: Bronze   Points : 2

*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    Author: jignesh    04 Feb 2011 Member Level: Gold   Points : 1

hi ControlToValidate is mandatory property for any validation control


hope this will help you

#586118    Author: vipul dumaniya    05 Feb 2011 Member Level: Silver   Points : 2

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.