Solved

Enter Key on ASP.Net Forms

Posted on 2006-07-07
4
172 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now