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: 2984     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: 87     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: 159     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: 148     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: 3490     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: 389     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: 194     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.



Next : What important standard is used to connect client browsers with web servers ?
Previous : Coding for print in windows based application
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages

Subscribe to Subscribers
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India