Making enter create a newline in a textbox on a webpage C# .asp

Posted on 2008-11-12
Last Modified: 2013-12-17
I have the following text box

<asp:TextBox ID="CommentsTextBox" runat="server" Height="260px" Width="342px"></asp:TextBox>

The only problem I have is when I press enter it's sending code back and crashes and I just want it
to create a newline

Does anyone know how to change this?

Question by:ShockUK
    LVL 48

    Accepted Solution

    You need to change the TextMode to "MultiLine"
    <asp:TextBox ID="CommentsTextBox" runat="server" Height="260px" Width="342px" TextMode="MultiLine"></asp:TextBox>

    Author Closing Comment

    So easy but so great

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now