views:

89

answers:

1

Hello,

I am looking to find a way to interpret user input as they type it (and eventually perform some types of actions as it happens based on their input) This is intended for a web based application.

So far I have a way that I can update a Label whenever the user hits enter, but I would like it so that the text updates on any keypress. Currently the code in a C# website in Visual Studio looks like this:

  protected void TextBox1_TextChanged(object sender, EventArgs e)
{
    Label1.Text = TextBox1.Text;
}

What would be the best language or approach to making it so any time a key is pressed within the box?

A: 

You are going to want to use Javascript (specifically the onkeyup function).

Andrew Hare