Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

KeyEventArgs e

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Claudia Fong - 11 Sep 2007 15:34 GMT
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
Tom Porterfield - 11 Sep 2007 15:47 GMT
> I have the code below:
>
[quoted text clipped - 12 lines]
>
> 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.
Signature

Tom Porterfield


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.