Enter Key on ASP.Net Forms

How can i use Enter Key on ASP.Net forms

Rgds,
Sohrab
sohrabusAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
YZlatConnect With a Mentor Commented:
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
 
deepaknetCommented:
You need to trap the KeyPress for KeyCode 13 and trigger the appropriate button click.
0
 
sohrabusAuthor Commented:
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
All Courses

From novice to tech pro — start learning today.