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,362
  • 12
  • 51
  • 102

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,551
  • 5
  • 24
  • 39
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
  • 18,509
  • 12
  • 59
  • 90