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

RadNumericTextbox to show error warning

3 Answers 177 Views
Input
This is a migrated thread and some comments may be shown as answers.
Stalin
Top achievements
Rank 1
Stalin asked on 01 Jul 2013, 12:37 PM
Hi,

To show up error icon in client site below code is working, 

args.set_cancel(true);
sender._invalid = true;
     sender.updateCssClass();

How to get the same behavior through code-behind, so that i can avoid writing JavaScript ?
I tried asp custom validator but not able to get the error warning icon.

Thanks,
Stalin

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 03 Jul 2013, 02:31 PM
Hello Stalin,

The client-side Invalid property for RadInput controls was introduced in Q2 2013. This property could be used to get or set the state of a control from the RadInput group on the client. It is a client-side property and its value is not persisted on the server. Also the server-side Invalid property is not affected by it. However if you set the server-side Invalid property to true, the client-side property will also be set to true.

In order to set a RadInput control as invalid on the server you could use the following line:

RadNumericTextBox1.Invalid = true;

After the property is set to true a Css class called .riError will be applied to the control.

Regards,
Viktor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Stalin
Top achievements
Rank 1
answered on 09 Jul 2013, 11:40 AM
I am able to use the client side api but the server-side is not available, RadNumericTextbix1.Invalid is not available in code-behind.
I have Telerik ASP.NET AJAX 2012.1.411.35 version. 

Thanks,
Stalin
0
Princy
Top achievements
Rank 2
answered on 09 Jul 2013, 12:43 PM
Hi Stalin,

The Invalid property was introduced in Q2 2013 release of RadControls. I tried the same code in the latest version of Telerik RadControls for ASP.NET AJAX and it worked fine at my end. So please update your RadControls to the latest version to get it working.

Thanks,
Princy.
Tags
Input
Asked by
Stalin
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Stalin
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or