Hi Joshy Varghese,
The handler that you have attached will be called on postback. For example, in case you add an ASP Button control and you click that button, the ServerValidate event of the custom validator will be raised even though the ControlToValidate property is not set. Have a look at the paragraph below - it is taken from MSDN
It is possible to use a CustomValidator control without setting the ControlToValidate
property. This is commonly done when you are validating multiple input controls or validating input controls that cannot be used with validation controls, such as the CheckBox
control. In this case, the Value
property of the arguments parameter passed to the event handler for the ServerValidate
event and to the client-side validation function always contains an empty string (""). However, these validation functions are still called, where appropriate, to determine validity on both the server and client. To access the value to validate, you must programmatically reference the input control you want to validate and then retrieve the value from the appropriate property. For example, to validate a CheckBox
control on the server, do not set the ControlToValidate
property of the validation control and use the following code for the handler for the ServerValidate
In case you have configured your color picker control to postback the page, you should additionally call the Validate method of the Page manually in the handler for the ColorChange event of the color picker control:
source, EventArgs args)
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Public Issue Tracking
system and vote to affect the priority of the items