Chris,
In an HTTP application, you are in a stateless environment. Therefore,
when the user of your application hits a key on their keyboard, there is no
way for the application running on the Web server to know this.
If you want to capture keyboard events, you will need to write client-side
code.
Jim Cheshire [MSFT]
Developer Support
ASP.NET
This post is provided as-is with no warranties and confers no rights.
--------------------
>From: "Chris Calhoun" <>
>Subject: Keyup, KeyDown, and KeyPress events for a datagrid do not work.
URGENT !!!!
>Date: Fri, 10 Oct 2003 15:37:39 -0400
>Lines: 16
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
>NNTP-Posting-Host: c1.wb1606.lnng.mi.voyager.net 216.93.72.3
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
>Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.datagridc ontrol:6992
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
>
>Here are the three event handlers I am trying to catch the key events, but
>they do not work.
>private void dgResults_KeyDown(object sender,
>System.Windows.Forms.KeyEventArgs e) {
>MessageBox.Show("Key Down!");
>}
>private void dgResults_KeyPress(object sender,
>System.Windows.Forms.KeyPressEventArgs e) {
>MessageBox.Show("Key Pressed!");
>}
>private void dgResults_KeyUp(object sender,
>System.Windows.Forms.KeyEventArgs e) {
>MessageBox.Show("Key Up!");
>}
>
>
>