Forums » .NET » .NET »

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


Posted Date: 04 Feb 2011      Posted By:: Vivek Ranjan Singh Profile photo    Member Level: Silver    Member Rank: 3010     Points: 1   Responses: 7



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




Responses

#586038    Author: Kaliss      Member Level: Gold      Member Rank: 84     Date: 04/Feb/2011   Rating: 2 out of 52 out of 5     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        Member Level: Gold      Member Rank: 157     Date: 04/Feb/2011   Rating: 2 out of 52 out of 5     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      Member Level: Gold      Member Rank: 9     Date: 04/Feb/2011   Rating: 2 out of 52 out of 5     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      Member Level: Gold      Member Rank: 147     Date: 04/Feb/2011   Rating: 2 out of 52 out of 5     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      Member Level: Bronze      Member Rank: 3512     Date: 04/Feb/2011   Rating: 2 out of 52 out of 5     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      Member Level: Gold      Member Rank: 391     Date: 04/Feb/2011   Rating: 2 out of 52 out of 5     Points: 1

hi ControlToValidate is mandatory property for any validation control


hope this will help you


 
#586118    Author: vipul dumaniya      Member Level: Silver      Member Rank: 191     Date: 05/Feb/2011   Rating: 2 out of 52 out of 5     Points: 2

hi

you must have to set

controlToValidate property of validation control

regards

vipul dumaniya


 
Post Reply

 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.



Return to Discussion Forum
Start new thread

Subscribe to Subscribers
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John

Online Members

Hammad salik
More...
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India