What the previous solutions have missed is the comment
"a web form". That suggests that your messages are being output to an HTML document.
HTML ignores line breaks and most white-space. To force the message to appear on multiple lines, you'll need to use
a <br>
tag[
^].
var operationResult = new BO.OperationResult();
var messages = new List<string>(3);
if (physicalLocationDesc.Trim().Length <= 0)
{
operationResult.Successful = false;
messages.Add("A location is required as part of the entry");
}
if (typeOfConnectionID.Trim().Length <= 0)
{
operationResult.Successful = false;
messages.Add("A description for the connection type is required.");
}
if (passwordChangeFrequency.Trim().Length <= 0)
{
operationResult.Successful = false;
messages.Add("Please enter a description for the Password Change Frequency");
}
if (messages.Count != 0)
{
operationResult.Message = string.Join("<br>", messages);
}