Enter Key and PostBack?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I noticed that I get a PostBack in my LoadPage() method whenever a user hits
the Enter Key in a TextBox in a browser window. Why do I get the Postback?
Can you identify that the Enter Key and which TextBox caused the PostBack? If
not is there some way (except for javascript) to get an event indicating that
the Enter Key was hit?
 
Sorry about the original post but both my javascript and html capabilities
are less than would be desired. I place the following code in my application
to detect the "Enter Key" being pressed and it seems to work ok.

Page.RegisterHiddenField("__EVENTTARGET", "btnSubmit");

Is there anything wrong with doing it that way?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top