I was creating a webpart and creating some custom edit values and I wanted to add a label for the dropdownlists I was adding.
Adding the label before the dropdown was fine but I needed the dropdown on the next line. I tried using "<br/>" but that gave me an error when I tried to build it in visual studio.
I tried System.Environment.NewLine but that didn't work and I tried "\n" with no luck and "\r\n" gave me an error when I tried to edit the webpart settings.
I noticed that it seemed like the webpart error was being thrown whenever I had a slash combination in the text (i.e. "\r", "</...>") so I tried the non-html compliant "<br>" tag and that finally worked.
Using this worked as well.
myControl.Add(new LiteralControl("
"))