text-formatting

ASP.Net MVC - Displaying text with newlines in

I have some text, stored in a table. I'm using asp.net mvc to display this. One of my views, has the following: <%=(Model.QuestionBody.Replace("\r\n", "<br/>").Replace ("\r", "<br/>")) %> Like this, it displays correctly However, if I omit the .Replace, it displays all on one line. The same data displayed in a TextBox however, displ...

How to apply colour formatting to a Richtextbox *as the user types* (VB.Net)

Hi. I have a RichTextBox with an OnChanged event. The OnChanged event should look at each line in the RichTextBox and if the line is of prime length colour it red, otherwise colour it black. How do I do this? I think it is possible to select from index a to index b and set selection colour, but I think this will lose my cursor position. ...