title: ASP.NET Replacing Line Break with HTML br not working
body: <p>Hi
  I am trying to submit some information into a database using an ASP.NET multiline textbox.
  I have the following code:</p>
  
  <pre><code>Dim noteContent As String = Replace(txtNoteContent.InnerText.ToString(), vbCrLf, "&lt;br /&gt;")
  Shop.Job.Notes.addNote(Request.QueryString("JobID"), ddlNoteFrom.SelectedValue, ddlNoteTo.SelectedValue, noteContent)
  </code></pre>
  
  <p>The addNote's function code is:</p>
  
  <pre><code>Public Shared Sub addNote(ByVal JobID As Integer, ByVal NoteFrom As Integer, ByVal NoteTo As Object, ByVal NoteContent As String)
              Dim newNote As New Job_Note
              newNote.Date = DateTime.Now()
              newNote.JobID = JobID
              newNote.NoteByStaffID = NoteFrom
              If Not NoteTo = Nothing Then
                  newNote.NoteToStaffID = CInt(NoteTo)
              End If
  
              newNote.NoteContent = NoteContent
  
              Try
                  db.Job_Notes.InsertOnSubmit(newNote)
                  db.SubmitChanges()
              Catch ex As Exception
              End Try
  
          End Sub
  </code></pre>
  
  <p>When it submit's the compiler does not seem to detect that line breaks have been entered into the textbox. I have debugged and stepped through the code, and sure enough, it just ignores the line breaks. If I try and replace another character instead of a line break, it works fine.</p>
  
  <p>It doesn't seem to be anything to do with my function, the LINQ insert or anything like that, it simply just doesn't detect the line breaks. I have tried VbCr, and also chr(13) but they do not work either.</p>
  
  <p>Can someone help me? I have been trying ad searching for over an hour trying to sort this.</p>
  
  <p>Thanks</p>