473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

KeyEventArgs e


I have the code below:

private void OnKeyDownHandler(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return)
{
TextBox2.Text = "You Entered: " + textBox1.Text;
}
}

but when I build the website it gaves me an error of

The type or namespace name 'KeyEventArgs' could not be found (are you
missing a using directive or an assembly reference?)

Does someone know what I'm missing?

Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***
Sep 11 '07 #1
1 7968
Claudia Fong wrote:
I have the code below:

private void OnKeyDownHandler(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return)
{
TextBox2.Text = "You Entered: " + textBox1.Text;
}
}

but when I build the website it gaves me an error of

The type or namespace name 'KeyEventArgs' could not be found (are you
missing a using directive or an assembly reference?)

Does someone know what I'm missing?
KeyEventArgs is in the System.Windows.Forms namespace (or
System.Windows.Input depending on what you are using for presentation)
but neither of those are included by default in a webpage.

Additionally, this appears to be server side code which would
potentially mean a postback on each keydown event. That would be a poor
experience for the user.

The web TextBox control only supports the TextChanged event server-side,
no key press type events.
--
Tom Porterfield
Sep 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dave | last post by:
The execution control does not jump here if I have button, textbox, etc in the window form. Works OK with an empty form. Thanks
1
by: Chaoxiang | last post by:
the KeyEventArgs.KeyCode is readonly, so I want to override it. How to do it? I create a class, public class ExteKeyEventArgs : KeyEventArgs { ExteKeyEventArgs(Keys keys) } but it has a...
8
by: Edward Diener | last post by:
If I try to reference System::Windows::Forms::KeyEventArgs in a header file I get the error: MyHeader.h(236) : error C2039: 'Windows' : is not a member of 'System' Any ideas why this is...
4
by: Dino Buljubasic | last post by:
can somebody help me please with this simple problem? I have combo box with numbers for months in it and want user to be able to select a month Say 3 (for March) simply by clicking a number...
5
by: **Developer** | last post by:
How do I know if the value in a KeyEventArgs is printable? Basicacally, in KeyUp I'd like to know if the character is printable, as opposed to say, a backspace. I suppose I could check...
2
by: Martijn Mulder | last post by:
How can I check the state of the modifier keys (Alt, Control, Shift) when there is no System.Windows.Forms.KeyEventArgs-object available (i.e. when not responding to a key-event)?
3
by: =?Utf-8?B?cGFucGF3ZWw=?= | last post by:
Is there a way to quickly determine if the key pressed was from 'A'-'Z' or '0'-'9' range? I really don't like to write switch with every Keys.A, Keys.B, etc key listed Paul
1
vinci
by: vinci | last post by:
Help Me!!!! T_T I want to create an instance of System.Windows.Forms.KeyEventArgs in vb.net for me to be able to use the .keyCode method of that class...is this possible??? basically, i want...
1
by: Eggbertx | last post by:
Ok I made a Windows Applications that makes the computer beep at a certain frequency when you press a letter key. Problem is, it doesn't do anything when it i out of focus. How do I make it continue...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.