This is a migrated thread and some comments may be shown as answers.

Validations

3 Answers 38 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 08 Dec 2008, 03:46 PM
Hello,

I see the RadControls have their own in-built validation into the controls, but when do those validations fire?  Do they prevent the page from being processed (set Page.IsValid to false) if a control is invalid?  Does the validation need manually triggered?  I see in some cases, the answer is no...

Thanks.

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 10 Dec 2008, 05:19 PM
Hello Brian,

That would depend on the specific Telerik control that you use. For example, RadScheduler's advanced form will validate for empty subject and end date being before start date.

Can you please describe in more detail the exact case that you are dealing with?


Greetings
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Brian Mains
Top achievements
Rank 1
answered on 10 Dec 2008, 07:53 PM
Like the controls that define the EmptyMessage, which pops up the animation that shows the error message...  how is that triggered?
0
Dimo
Telerik team
answered on 13 Dec 2008, 11:29 AM
Hello Brian,

Telerik textboxes (RadTextBox, RadDateInput, RadNumericTextBox, RadMaskedTextBox) analyze what the user has entered and can change their appearance accordingly.

The EmptyMessage is applied when a textbox has been blurred and contains nothing.

The invalid state appearance is applied by RadDateInput when it cannot parse the entered value to a valid date. It is also used by RadNumericTextBox and RadMaskedTextBox if you try to type something invalid inside (for example a letter inside the numeric textbox).

The textboxes cannot prevent postback by default - you can use some validators for this purpose, e.g.:

http://demos.telerik.com/aspnet-ajax/Input/Examples/Common/Validation/DefaultCS.aspx


Alternatively, you can implement some custom client-side logic, which analyzes the textboxes' values and perform some actions. You can use the controls' OnValueChanged, OnValueChanging and OnError client-side event handlers.

OnValueChanging
OnValueChanged
OnError




http://demos.telerik.com/aspnet-ajax/Input/Examples/Programming/ClientSide/OnError/DefaultCS.aspx


Let us know if you need more information.


Sincerely yours,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Peter
Telerik team
Brian Mains
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or