RadTextBox Line Break Issues

2 posts, 0 answers
  1. Pat
    Pat avatar
    31 posts
    Member since:
    Dec 2011

    Posted 28 Dec 2011 Link to this post

    I am using the RadTextBox with MultiLine enabled.  The issue i am having is that i need to determine whether or not there have been changes from what is being held in the database, and if there has been changes then display a warning message.  Chrome, Safari, Firefox all work fine; however, in Internet Explorer and Opera new lines are changed from  Line Feeds (\n) to a Carriage Return followed by a Line Feed (\r\n). Therefore, even if a person doesn't make changes to the RadTextBox, Internet Explorer/Opera will see the string coming from the database (the string with just \n's) different from what's in the RadTextBox (the string with \r\n's).  

    I have attached images of what is being displayed, along with what is being seen in the RadTextBox (ContentEditor.Text) and what is being seen in the database (CurrentContent).  Also, below should be a snippet of the aspx code for my RadTextBox:

    <telerik:RadTextBox runat="server" ID="ContentEditor" Height="200px" Width="580px" TextMode="MultiLine"
    Wrap="true" ></telerik:RadTextBox>

    Is there anyway to fix this, or is there a reason why this is happening?

    Thanks again for the help,

    - Pat
  2. Pat
    Pat avatar
    31 posts
    Member since:
    Dec 2011

    Posted 28 Dec 2011 Link to this post

    Fixed the issue.

    When comparing the database and the radtextbox content, i replaced all linefeeds and carriage returns to "" in both and then compared them.  Thanks anyways for the help!

    -  Pat
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top