Solved

Handle Keypress event on a WebForm?

Posted on 2004-04-28
3
383 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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 …
Starting up a Project

617 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