Multiline RadTextBox: new line does not display in IE

6 posts, 1 answers
  1. Leonard
    Leonard avatar
    3 posts
    Member since:
    Feb 2014

    Posted 06 Feb 2014 Link to this post

    Hello everybody,

    When I am trying to set the text of a Multiline RadTextBox from CodeBehind, Internet Explorer (tested with 9 & 11) does not render new lines.
    The text is coming from our database and lines are separated by "\r\n" - which should work in a textarea according to various other pages. Firefox and Chrome display it perfectly fine, while IE doesn't work (see attachments).

    The text coming from the database is:
    "06.02.2014 10:57, LeonardTest: defg\r\n06.02.2014 10:57, LeonardTest: hijk\r\n06.02.2014 10:57, LeonardTest: abcd\r\n"

    I also tried replacing "\r\n" by "&#10;" (html new line) as well as <br />, but neither of them work.

    Does anyone know a solution for this problem? It would be greatly appreciated!

    Thanks
    Leonard
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Feb 2014 in reply to Leonard Link to this post

    Hi Leonard,

    Unfortunately I couldn't replicate the issue at my end. Please have a look into the sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadTextBox TextMode="MultiLine" ID="RadTextBox1" runat="server">
    </telerik:RadTextBox>

    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadTextBox1.Text="Hello\r\nHai";
    }

    Let me know if you have any concern.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Leonard
    Leonard avatar
    3 posts
    Member since:
    Feb 2014

    Posted 06 Feb 2014 Link to this post

    Hi Shinu,

    thanks for your quick reply!

    However, when I replaced the text coming from the database with your snippet, it still doesn't work in IE, while FF displays it correctly - again.
    I am using the newest telerik and .Net versions. Here is the code of my textbox - is it possible that the resource file causes this issue? The text is only set in code behind, though.

    <telerik:RadTextBox ID="txtHeaderRemarks" runat="server" TextMode="MultiLine" Label="Remarks" LabelWidth="90px" Width="886px" Height="60px" meta:resourcekey="txtHeaderRemarksResource1">
    </telerik:RadTextBox>
  5. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Feb 2014 in reply to Leonard Link to this post

    Hi Leonard,

    I am not able to replicate the issue at my end, given code is working fine for me. One suggestion is that you can use Environment.NewLine  which inserts a new line in a string. Please try the following C# code snippet which works fine at my end.

    C#:
    txtHeaderRemarks.Text = "This is an example"+Environment.NewLine+"New line";

    Thanks,
    Shinu.
  6. Leonard
    Leonard avatar
    3 posts
    Member since:
    Feb 2014

    Posted 19 Feb 2014 in reply to Shinu Link to this post

    Hi,
    unfortunately, your last idea did not work either and we could not find any solution until we upgraded to the Q3 2013 SP2 version - now the bug has been gone. So it seems like it was a telerik issue, with the newest version everything's fine.

    Thanks a lot,
    Leonard
  7. Venelin
    Admin
    Venelin avatar
    352 posts

    Posted 24 Feb 2014 Link to this post

    Hi Leonard,

    You are correct, this was an issue with IE11 that was reported by a client and fixed.

    Regards,
    Venelin
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017