Textbox works fine, but if I try to cancel some char input with
e.Handled = true
it doesn’t work.
Keyboard events, like all events in Wisej, are routed to the server asynchronously. The Handled property is useful on the server side when managing the OnKeyDown/Up/Press events to signal that a child has handled the key. However, this has no effect on the client, unless you actually change the Text property to trigger a client update – I wouldn’t recommend this approach unless really necessary.
Keeping the script above as a reference, we attach the “keypress” handler and handle the event. To stop it from both bubbling and “defaulting” use e.stop(). Otherwise you can use e.stopBubbling() and e.preventDefault().
Please login first to submit.