Design and CSS styles
Version 5.x > Design and CSS styles > Multiline Text Box View modes: 
User avatar
Member
Member
caramoSC - 10/23/2012 2:50:15 PM
   
Multiline Text Box
I have a user control that contains a multiline textbox. I need to allow the user to press the enter key to add a new line, but it does not work. I have wrap set to false.

The user control is used on a portal engine page with a masterpage.

How can I allow the user to press enter to insert a new line within the multiliine textbox?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 10/24/2012 2:43:17 AM
   
RE:Multiline Text Box
Hello,


do you use this User control: User control on a Portal template?

What control do you use exactly there? <asp:TextBox TextMode="MultiLine"...?

Does the control work with Enter outside Kentico CMS?


Best regards,
Helena Grulichova

User avatar
Member
Member
caramoSC - 10/24/2012 7:22:04 AM
   
RE:Multiline Text Box
Yes, I am using this <asp:TextBox TextMode="MultiLine"...?

It works outside of Kentico.....

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 10/25/2012 5:07:53 AM
   
RE:Multiline Text Box
Hello,


I tested the control within the User control web part and it works fine.

In your case: if you press Enter, does it create a new line in the textbox but not in the output, or it does not create a new line within the input?

I only needed to convert \n to any other "end line" character when I wanted to display multiline output by HTML, for example:

(tb3.Text).Replace("\n", "<br />")


Best regards,
Helena Grulichova