Solved

Enter Key on ASP.Net Forms

Posted on 2006-07-07
4
177 Views
Last Modified: 2010-04-06
How can i use Enter Key on ASP.Net forms

Rgds,
Sohrab
0
Comment
Question by:sohrabus
  • 2
4 Comments
 
LVL 15

Expert Comment

by:deepaknet
ID: 17057517
You need to trap the KeyPress for KeyCode 13 and trigger the appropriate button click.
0
 
LVL 15

Expert Comment

by:deepaknet
ID: 17057529
0
 
LVL 35

Accepted Solution

by:
YZlat earned 50 total points
ID: 17058198
you'll have to use javascript. Call this function on KeyDown event to check what key was pressed

function CaptureKeys() {
      if (event.keyCode == 13) {
            //your code here
      }
}
0
 

Author Comment

by:sohrabus
ID: 17070554
in VB.Net DeskTop Appl.
i set forms KeyPreview Property = True

and on Fomrs_KeyDown Event

If (e.KeyCode=Keys.Enter) then
   SendKeys "{TAB}"
End If

This works fine for all object on the form.
Is there any way to do like this in ASP.Net

Thanks,
Sohrab
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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

735 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