Solved

Handle Keypress event on a WebForm?

Posted on 2004-04-28
3
365 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

789 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