I got different reaction (output in console) when using inline delegate or when implementing a handler in @functions section. I don't understand why! Is that a bug or something is missing me?
<input type="text" onkeyup="@(e => Console.Write(e.Key))" />
It gives me immediate output in console. But when I use a handler like this, I got nothing:
<input type="text" onkeyup="@showKey"/>
@functions{
void showKey(UIKeyboardEventArgs e){
Console.Write(e.Key);
}
}
Both don't work for me with your code. But do work when I change them to Console.WriteLine(e.key)
I guess Console.Write
is not supported because browsers don't support this, Console.Writeline
translates to console.log
and Console.Write
has nothing to translate to.