New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
OnError
The OnError event handler is raised when the user presses a keyboard key while the textbox extended via the RadInputManager has focus, and an error occurs - for example when trying to enter a character in a Numeric textbox.
The signature of the event handler is unified and is the same as in the other client side event handlers available for the control. It receives two arguments - the sender which raised the event, and another argument, which gives access to additional client side methods.
Below is a small code snippet, which demonstrates how to get the reason for the error message - a parse exception, or an Out-Of-Range exception:
JavaScript
function OnError(sender, eventArgs)
{
var errorReason = eventArgs.get_reason() == 1 ? "Parse Exception" : "Out Of Range Exception";
alert(errorReason);
}