1

I want to make an ASP.NET multilined TextBox to trigger the button1_Click() event instead of going newline when ENTER key is pressed. Note that this button is not in a form tag.

Aishwarya Shiva
  • 3,460
  • 15
  • 58
  • 107

2 Answers2

0

Do it with onkeypress and check it if it was enter do button1_performclick().that will do the job for you

Abadis
  • 2,671
  • 5
  • 28
  • 42
0

You will have to track onkeypress of TextBox and check it if key pressed was enter or not, If entered was pressed then perform __dopostback which will postback your form and on page_load check for its arguments. For more information on __dopostback Go here

Community
  • 1
  • 1
yogi
  • 19,175
  • 13
  • 62
  • 92