Quantcast
Channel: asp.net textarea line feed and preventing postback on return key - Stack Overflow
Viewing all articles
Browse latest Browse all 3

asp.net textarea line feed and preventing postback on return key

$
0
0

I have an ASP.net web application with numerous pages. Most of them have Multiline APS.net textbox and standard text box. Pressing the return key has unexpected result depending on browsers, page, last control used. It can fire any control either the master or the child page. Sometimes hitting the return key even fire the logout control.

So to prevent this I added:

body onkeydown="return (event.keyCode!=13)"

In the the master page body tag as recommended in many places, which works like a charm. However, this cause the the return key not to respond to line feed in text area. Users need to be able to insert line feed in Text area ( TextBoxMode.MultiLine)

How can I prevent this behavior?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images