Hi all!
Please, help me
I have button 'Save' and TextBox on my WebForm.
When i press 'Enter' in my textbox i need to add a new line, and not press 'Save' button.
What should i do?
Thx in advance!
Printable View
Hi all!
Please, help me
I have button 'Save' and TextBox on my WebForm.
When i press 'Enter' in my textbox i need to add a new line, and not press 'Save' button.
What should i do?
Thx in advance!
I think you can have two alternatives.
1) Change the button Save to LinkButton.
2) Add a piece of client script (javascript) to your TextBox for event onkeypress, check if the key code is 13, i.e. Enter is pressed, you make a call to the PostBack function.
For detail, refer to Page.GetPostBackClientHyperlink().
Ohhhhhhhhhh.. sorry. After I clicked the sumit, I found I misunderstand your question.
If you want a new line by pressing Enter, you should use multi-line TextBox, just change the TextMode property, you will get what you want.
:)