Solved

Handle Keypress event on a WebForm?

Posted on 2004-04-28
3
360 Views
Last Modified: 2008-03-10
Hi there!

I want to call a CodeBehind Function on a WebForm by pressing "return" (or any other key).
I only know the keypress event on windows.forms, but how can i use something equal in WebForms?
Please help me out!

Regards
Claudio
0
Comment
Question by:Chillahh
3 Comments
 
LVL 9

Accepted Solution

by:
Thalox earned 125 total points
ID: 10938911

i think there is no "direct" way to do this.

but you can catch the event on the client with javascript (add onKeyPressed - event to an element)
and in this eventhandler put the captured keyvalue in a hidden inputfield and post back your page to the sever.

now you just need to evaluate the value of this field in your code-behind page and call your function

Hope this helps,

Thalox
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Specific format 21 198
base64 decode encode 12 134
Controlled Assessment GCSE - desperate help needed 4 85
Windows and other UI names - The Proper names for the Various elements! 1 84
A short article about a problem I had getting the GPS LocationListener working.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question