I have a problem that is just making me feel silly.... Given the following code in Razor:
@{
...
if (purchasedEvent.Address != null && purchasedEvent.Address != String.Empty){
addressBlock.AppendFormat("{0}<br />", purchasedEvent.Address);
}
...
}
@addressBlock.ToString()
The <br />
gets treated as literal text (that is to say I end up seeing something like 123 Cool Street<br />Anytown...
rendered on the page. Changing the code (back) to addressBlock.AppendLine(purchasedEvent.Address)
doesn't do any good either (renders 127 Cool Street Anytown...
. What do I need to do to make the Razor engine respect that line break?